/ Docs
7.5
/
Table of Contents

Etherscan

Note
Examples below are for Ethereum mainnet. For other supported networks, see EVM Networks.

Etherscan is a popular Ethereum blockchain explorer. It provides a public API to fetch ABIs of verified contracts. DipDup can use its API to fetch ABIs for contracts being indexed.

Explorers of other EVM networks (e.g. BscScan, PolygonScan) are usually based on Etherscan and have similar APIs.

To use this datasource, add the following section in config:

dipdup.yaml
datasources:
  etherscan:
    kind: abi.etherscan
    url: ${ETHERSCAN_URL:-https://api.etherscan.io/api}
    api_key: ${ETHERSCAN_API_KEY:-''}

During initialization, DipDup will use this datasource to fetch contract ABIs. If your config contains definitions for multiple networks, you can assign the datasource explicitly in evm.subsquid index definitions:

dipdup.yaml
indexes:
  evm_events:
    kind: evm.subsquid.events
    abi:
    - etherscan
    ...

Authorization

If you have an Etherscan API key, you can set it in config. You may also want to increase the ratelimit according to your subscription plan. Otherwise, you will be limited to 5 requests per second.

dipdup.yaml
  etherscan:
    kind: abi.etherscan
    url: ${ETHERSCAN_URL:-https://api.etherscan.io/api}
    api_key: ${ETHERSCAN_API_KEY:-''}
    http:
      ratelimit_period: 1
      ratelimit_rate: 10
Help and tips -> Join our Discord
Ideas or suggestions -> Issue Tracker
Table of Contents