Skip to content
TraceFast Docs

Function selectors of a contract

Open the contract on its entity page →

The 4-byte function selectors found in a contract's bytecode, each resolved to a known signature and name where one exists, with how many known signatures share the selector.

GET https://tracefast.xyz/api/v1/chains/1/contracts/{address}/selectors
ParameterInTypeNotes
addresspathstring0x-prefixed, 40 hex characters, any case

Access — an API key on the Enriched Data plan or higher (plans), or no key at all: pay per call with x402 at the same path on https://mpp.tracefast.xyz/api/v1, at the price its 402 states. As a tool for AI agents: get_contract_selectors on the MCP server. Stable — see stability.

chains/1 is a literal: other chain ids answer 404 chain_not_supported. The method takes no query parameters — an unknown one is refused rather than ignored.

What it covers, and what it does not

  • Selectors come from the bytecode, not from a verified source or an ABI. A proxy answers with its own selectors, not its implementation's: ask this method about the implementation address from the proxy method.
  • A signature is a best match, not proof. A selector is only 4 bytes, and unrelated signatures collide. When candidateCount is above 1, signature is the most common known one. The 0xffffffff row in the example below is such a match: the name is a known collision, not a function the contract declares.
  • abi_missing is not "no function". The selector is in the code; no known signature has it.

Response

200 application/json, the USDC proxy:

{
  "data": {
    "chainId": 1,
    "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "codeHash": "0xd80d4b7c890cb9d6a4893e6b52bc34b56b25335cb13716e0d1d31383e6b41505",
    "selectorCount": 6,
    "selectors": [
      { "selector": "0x8f283970", "signature": "changeAdmin(address)", "name": "changeAdmin", "candidateCount": 2, "decodeStatus": "ambiguous" },
      { "selector": "0xf851a440", "signature": "admin()", "name": "admin", "candidateCount": 1, "decodeStatus": "partial" },
      { "selector": "0xffffffff", "signature": "LOCK8605463013()", "name": "LOCK8605463013", "candidateCount": 3, "decodeStatus": "ambiguous" },
      { "selector": "0x3659cfe6", "signature": "upgradeTo(address)", "name": "upgradeTo", "candidateCount": 2, "decodeStatus": "ambiguous" },
      { "selector": "0x4f1ef286", "signature": "upgradeToAndCall(address,bytes)", "name": "upgradeToAndCall", "candidateCount": 2, "decodeStatus": "ambiguous" },
      { "selector": "0x5c60da1b", "signature": "implementation()", "name": "implementation", "candidateCount": 1, "decodeStatus": "partial" }
    ]
  },
  "meta": {
    "chain": "ethereum",
    "timestamp": 1789047625629,
    "cached": false,
    "docs": "https://docs.tracefast.xyz/api/contract-selectors"
  }
}

data

FieldMeaning
chainId1 — Ethereum mainnet
addressthe contract, lowercase
codeHashhash of the code the selectors were read from
selectorCounthow many selectors were found
selectors[]every selector, each with its resolution

A selector

FieldMeaning
selectorthe 4-byte selector, 0x-prefixed
signaturethe canonical signature, for example transfer(address,uint256). Absent when no known signature has this selector, or when the only one known is malformed
namethe function name alone, present whenever the selector is named. It can be present without signature: when the only known signature is malformed (say transfer(address uint256)), only the name is served
candidateCounthow many known signatures share the selector. 1 is unambiguous
decodeStatuspartial — one known signature, parameter names unknown; ambiguous — several known signatures share the selector; abi_missing — no known signature

How a selector is derived from a function signature: ethereum.org — smart contract ABI.

Errors

StatuscodeWhendetails
404not_foundno contract code is indexed at this address—
422block_not_availablereason: coverage_gap — recent blocks are in a coverage gap, and a contract deployed in them cannot be seen right now. Retry latercoverageGapFromBlock, coverageGapToBlock, maxAvailableBlock

Malformed input, unknown parameters and the key check's 401/403/429 are the same for every method — see conventions and API keys.


Last updated 22 Oct 2026, 08:06 UTC · verified against TraceFast v1.0.261 · Markdown