Retrieving Contract Metadata

The Hashless Catalog API can be queried for any Ethereum address, including smart contract addresses and externally-owned account ("EOA") addresses, or "wallets". Typically users query the Catalog for metadata about smart contracts and protocols.

Behind the scenes, Hashless indexes all 50+ million deployed smart contracts ever deployed on Ethereum. Data on contract technical functionality (such as whether the contract is a proxy, and if so which type) is available as well as data about detected financial behaviors.

Additionally, Hashless's technology has automated provenance detection for hundreds of decentralized finance protocols, asset issuers, and DAOs. This means that for over 5 million contracts, they can be mapped back to their originating or controlling protocol. Including, for example, over 100,000 Uniswap liquidity pools – with more deployed and instantaneously labeled as part of the Uniswap protocol every day.

Bulk Retrieval of Basic Metadata

Basic name and protocol ownership information can be retrieved for up to 100 addresses at a time via the "Bulk Query Addresses" endpoint.

{
 "addresses": {    
  "0xe592427a0aece92de3edee1f18e0157c05861564": {
      "name": "Uniswap V3: Router",
      "belongs_to": "Uniswap",
      "contract": {
        "creator": "0x6c9fc64a53c1b71fb3f9af64d1ae3a4931a5f4e9",
        "created_in_transaction": "0xe881c43cd88063e84a1d0283f41ee5348239b259c0d17a7e2e4552da3f4b2bc7",
        "creation_timestamp": 1620156641000,
        "bytecode_hash": "0xbb90113d2f9a5e9b7feb15a1d1fff06c1ee1575b3f9b1181778ffd0cf633e7ea",
        "labels": []
      }
    },
    "0x4b5ab61593a2401b1075b90c04cbcdd3f87ce011": {
      "name": "Uniswap V3: LOOKS-WETH",
      "belongs_to": "Uniswap",
      "contract": {
        "creator": "0xc69b462d6e06e9df218243c7f487aea68926705f",
        "created_by_contract": "0x1f98431c8ad98523631ae4a59f267346ea31f984",
        "created_in_transaction": "0x4163e5d06aa6d974b0898a6fa89473516716ade2c38d90d1b20bb814a69a6fb1",
        "creation_timestamp": 1641845607000,
        "bytecode_hash": "0x62260badf74461e82263fd68b683c075fa1d1ec322d2e546f31025db2aa03738",
        "labels": []
      }
    }
  }
}

Retrieval of Detailed Metadata

Individual addresses can be queried via the "Get Address Detail" endpoint.

{
  "address": "0x397ff1542f962076d0bfe58ea045ffa2d347aca0",
  "name": "SushiSwap: USDC-WETH",
  "belongs_to": "SushiSwap",
  "contract": {
    "creator": "0xd57581d9e42e9032e6f60422fa619b4a4574ba79",
    "created_by_contract": "0xc0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac",
    "created_in_transaction": "0x9011586359ddfc2660fe5bcdf2b53f1d4238ab4f4f998bc79a8cd69aa7c9040d",
    "creation_timestamp": 1599678405000,
    "bytecode_hash": "0xcd82e2d9daddbf51cbce8d5429a0996e16fc670c4056566f19cf8864ad45a746",
    "labels": [
      "Token"
    ]
  },
  "chain_metadata": {
    "name": "SushiSwap LP Token",
    "symbol": "SLP",
    "decimals": 18
  },
  "program": {
    "delegates": [],
    "functions": [
      {
        "selector": "0x3644e515",
        "signature": "DOMAIN_SEPARATOR()",
        "name": "DOMAIN_SEPARATOR"
      },
    	// ...
      {
        "selector": "0xa9059cbb",
        "signature": "transfer(address,uint256)",
        "name": "transfer"
      },
      {
        "selector": "0x23b872dd",
        "signature": "transferFrom(address,address,uint256)",
        "name": "transferFrom"
      }
    ]
  }
}

Some information of note:

  • name indicates the name of the address. This can be a name retrieved from the on-chain name() function, an ENS name, or a manually- or automatically-assigned name based on provenance rules.
  • belongs_to indicates the protocol the address belongs to. In most cases, only contracts will be associated with a protocol. In a few rare cases, EOA addresses will be associated if they are well-known to be exclusively associated with the protocol in question (for example: well-known "keeper" bot addresses that automatically submit transactions that perform protocol "maintenance", CEX wallet addresses that user funds are swept into, etc.).
  • All smart contract addresses will contain a contract field. Any address without contract data can be assumed to be a wallet.
🚧

Edge Case

It's technically possible for an address to be mentioned on-chain and later have a contract deployed to it -- if the address in question does not originate any transactions and only receives native Ether or asset transfers. Once the contract has been deployed at the address, Hashless will pick it up and begin returning a contract field.

  • contract.creator identifies the EOA address ("end user") that submitted the transaction that resulted in the contract being created. Note that in some cases contracts are deployed as "side effects" of a transaction via factory contracts -- the originating EOA may not even be aware the contract was created.
  • contract.created_by_contract identifies the factory contract that created the contract in question. In the example shown, this is the SushiSwap Liquidity Pool Factory. Factories are frequently used to allow users to deploy "template-ized" contracts like permissionless liquidity pools and "multi-sig" treasuries, but in some cases are used to deploy a wider variety of contracts (usually as part of a protocol's governance or operations processes).
  • contract.bytecode_hash uniquely identifies the underlying Ethereum Virtual Machine program independent from any dynamic or per-deployment state. For example, all Uniswap liquidity pools of a given version will have the same bytecode hash. The hash used is identical to the results of the EXTCODEHASH EVM opcode.

Did this page help you?