Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

contract-deploy-tracker

Track and analyze smart contract deployments across EVM chains. CLI tool built with Python, Click, and Rich.

Supported Chains

Chain Explorer API RPC Endpoint
Ethereum api.etherscan.io rpc.ankr.com/eth
Base api.basescan.org rpc.ankr.com/base
Arbitrum api.arbiscan.io rpc.ankr.com/arbitrum
Optimism api-optimistic.etherscan.io rpc.ankr.com/optimism
Polygon api.polygonscan.com rpc.ankr.com/polygon

Installation

cd contract-deploy-tracker
pip install -r requirements.txt

Or with pipx:

pip install click requests rich

Configuration

API keys are optional but recommended (free tier = 5 req/sec, with key = 10+ req/sec).

# Generic key (used for all chains as fallback)
export ETHERSCAN_API_KEY="YOUR_KEY"

# Chain-specific keys (override generic)
export BASESCAN_API_KEY="YOUR_BASE_KEY"
export ARBISCAN_API_KEY="YOUR_ARB_KEY"
export OPSCAN_API_KEY="YOUR_OP_KEY"
export POLYGONSCAN_API_KEY="YOUR_POLYGON_KEY"

Get free API keys at:

Usage

Scan recent blocks for contract deployments

# Scan last 10 blocks on Ethereum (default)
python deploy_tracker.py recent

# Scan last 50 blocks on Base
python deploy_tracker.py recent -c base -n 50

# Export to JSON
python deploy_tracker.py recent -c ethereum -n 20 --export json -o deployments.json

Analyze a deployer address

# Show contracts deployed by an address
python deploy_tracker.py deployer 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

# Include verification checks
python deploy_tracker.py deployer 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --check-verify

# Export to CSV
python deploy_tracker.py deployer 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --export csv

Check contract verification status

# Single contract
python deploy_tracker.py verify 0xdAC17F958D2ee523a2206206994597C13D831ec7

# Multiple contracts
python deploy_tracker.py verify \
  0xdAC17F958D2ee523a2206206994597C13D831ec7 \
  0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  0x6B175474E89094C44Da98b954EedeAC495271d0F

Track factory deployments

# All known factories on Ethereum
python deploy_tracker.py factory

# Filter by name
python deploy_tracker.py factory --factory "Uniswap"

# On Arbitrum
python deploy_tracker.py factory -c arbitrum -n 30

Known factories tracked:

  • Uniswap V3 Pool Deployer — CREATE2 pool contracts
  • Uniswap V2 Factory — pair contracts via CREATE2
  • Create2 Deployer (0x13b0) — generic CREATE2 deployer
  • Safe ProxyFactory — Gnosis Safe wallet proxies
  • EIP-1167 Minimal Proxy Deployer — clone contracts

Deployment statistics

# Stats for last 100 blocks (default)
python deploy_tracker.py stats

# Last 500 blocks on Polygon
python deploy_tracker.py stats -c polygon -n 500

# Export stats
python deploy_tracker.py stats -n 200 --export json -o stats.json

Output includes:

  • Total deployments and gas consumed
  • Blocks with active deployments
  • Average deployments per block
  • Top 15 deployers with gas usage and market share

Inspect a specific contract

# Full inspection
python deploy_tracker.py inspect 0xdAC17F958D2ee523a2206206994597C13D831ec7

# On Base
python deploy_tracker.py inspect 0x... -c base

Shows:

  • Creation transaction and deployer
  • Bytecode size
  • Proxy detection (EIP-1967 and EIP-1167)
  • Verification status and source code snippet
  • Contract name (if verified)

Configuration and cache

# Show current config
python deploy_tracker.py config

# Cache management
python deploy_tracker.py cache
python deploy_tracker.py cache --clear
python deploy_tracker.py cache --show-dir

Export Formats

All subcommands support --export csv or --export json with optional -o FILE:

# JSON to file
python deploy_tracker.py recent --export json -o recent.json

# CSV to stdout
python deploy_tracker.py stats --export csv

How It Works

Block Scanning (RPC)

Uses eth_getBlockByNumber with full transaction objects (true param). Contract creation transactions are identified by to=null or empty to field.

Contract Lookup (Etherscan API)

  • getcontractcreation — find deployer of specific contracts
  • txlist — list transactions for deployer analysis
  • txlistinternal — find internal (factory) contract creations
  • getabi / getsourcecode — check verification status

Proxy Detection

  1. EIP-1967: Reads storage slots for implementation, admin, and beacon addresses
  2. EIP-1167: Bytecode pattern matching for minimal proxy (45-byte clone pattern)

Rate Limiting

  • 5 requests/sec per API domain (free tier default)
  • Automatic retry on rate limit errors
  • Per-domain tracking to support multi-chain queries

Caching

  • Cached at ~/.contract-deploy-cache/
  • API responses: 300s TTL
  • RPC responses: 60s TTL
  • SHA-256 keyed by URL + parameters

Output Example

                  Contract Creations on Ethereum (10 blocks)
┌──────────┬──────────────┬──────────────┬──────────┬─────────────┬───────────────────┐
│ Block    │ Deployer     │ Tx Hash      │ Gas      │ Bytecode Sz │ Timestamp         │
├──────────┼──────────────┼──────────────┼──────────┼─────────────┼───────────────────┤
│ 19,234,567│ 0x1234...abcd│ 0xabcd...1234│ 1,234,567│ 12,345 B    │ 2025-01-15 12:00  │
│ 19,234,566│ 0x5678...ef01│ 0xef01...5678│ 2,345,678│ 23,456 B    │ 2025-01-15 11:59  │
└──────────┴──────────────┴──────────────┴──────────┴─────────────┴───────────────────┘

┌─ Summary ──────────────────────────────┐
│ Total deployments: 42                  │
│ Unique deployers: 15                   │
│ Total gas used: 125,000,000           │
│ Avg bytecode size: 8,234 bytes         │
└────────────────────────────────────────┘

License

MIT

About

CLI to track and analyze smart contract deployments across EVM chains — Etherscan API, block scanning, proxy detection, factory tracking

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages