Skip to content
TraceFast Docs

Disassembly of a contract

Open the contract's Code tab →

A contract's code as EVM instructions, each with its byte offset (pc), in order, a page at a time. These are the same offsets the decompiled view cites, so a line of pseudocode can be found in the instructions.

GET https://tracefast.xyz/api/v1/chains/1/contracts/{address}/disassembly
ParameterInTypeNotes
addresspathstring0x-prefixed, 40 hex characters, any case
blockqueryinteger, optionalthe block to resolve the code at. Default: the latest covered block
targetquerystring, optionalauto (default) — the code that runs at the address, one hop through a proxy; self — the address's own code
limitqueryinteger, optionalinstructions per page, 1..5000, default 1000
cursorquerystring, optionalnextCursor of the previous page. Opaque, and valid only for the same address, target and block

Access — an API key on the Enriched Data plan or higher (plans). Not sold over x402 yet. As a tool for AI agents: get_contract_disassembly on the MCP server. Stable — see stability.

chains/1 is a literal: other chain ids answer 404 chain_not_supported. An unknown query parameter is refused rather than ignored.

How to read it

  • Which code. As on the decompiled view: target=auto follows one hop through a proxy, a beacon, a minimal proxy or an EIP-7702 delegation; target.resolvedVia says how, and target.codeAddress whose code it is.
  • The tail is data. Compilers append metadata to the end of the code. Its bytes decode as instructions, but they never run. metadata names the range, and every instruction with a byte inside it carries inMetadata: true.
  • A byte that is not an opcode is listed with op: "?". A PUSH whose argument runs past the end of the code carries truncated: true, and arg holds the bytes that exist.
  • Pages. Pass nextCursor back as cursor until it is absent. instructionCount is the whole code, every page together.

What each opcode does: ethereum.org — opcodes.

Response

200 application/json, WETH, ?limit=6:

{
  "data": {
    "chainId": 1,
    "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "block": 26389912,
    "target": {
      "mode": "auto",
      "resolvedVia": "own",
      "codeAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "codeHash": "0xd0a06b12ac47863b5c7be4185c2deaad1c61557033f56c7d4ea74429cbb25e23"
    },
    "codeSize": 3124,
    "instructionCount": 1577,
    "metadata": { "fromPc": 3081, "length": 43 },
    "instructions": [
      { "pc": 0, "op": "PUSH1", "arg": "0x60" },
      { "pc": 2, "op": "PUSH1", "arg": "0x40" },
      { "pc": 4, "op": "MSTORE" },
      { "pc": 5, "op": "PUSH1", "arg": "0x04" },
      { "pc": 7, "op": "CALLDATASIZE" },
      { "pc": 8, "op": "LT" }
    ],
    "nextCursor": "AVs5LCJkMGEwNmIxMmFjNDc4NjNiNWM3YmU0MTg1YzJkZWFhZDFjNjE1NTcwMzNmNTZjN2Q0ZWE3NDQyOWNiYjI1ZTIzIl2QPnvCqcU-9RI_fdWriIPE"
  },
  "meta": {
    "chain": "ethereum",
    "timestamp": 1794384199067,
    "cached": false,
    "asOfBlock": 26389912,
    "docs": "https://docs.tracefast.xyz/api/contract-disassembly"
  }
}

data

FieldMeaning
chainId1 — Ethereum mainnet
addressthe address asked about, lowercase
blockthe block the code was resolved at
targetwhich code this is — mode, resolvedVia, codeAddress, codeHash, and targetUnresolved when auto found nothing proven to follow; see the decompiled view
codeSizebytes of code
instructionCountinstructions in the whole code, every page together
metadatathe compiler's metadata at the end of the code: fromPc — offset of its first byte, length — in bytes. Absent when the code has none
instructions[]the page's instructions, in pc order
nextCursorpass as cursor for the next page; absent on the last page

An instruction

FieldMeaning
pcbyte offset of the instruction in the code
opthe mnemonic, for example PUSH1 or SSTORE; ? for a byte that is not an opcode
argthe PUSH argument, 0x-prefixed; absent for every other instruction
inMetadatapresent (true) only when a byte of the instruction lies inside the compiler's metadata
truncatedpresent (true) only for a PUSH whose argument runs past the end of the code

Errors

StatuscodeWhendetails
400bad_requestreason: target_invalid, or limit outside 1..5000reason
400invalid_cursorthe cursor is not valid for this request — restart from the first page—
404not_foundno code is proven to run at the address at that block, or its bytes are not available—
422block_not_availableblock is past the covered historymaxAvailableBlock
422code_too_largethe code is larger than one read disassemblescodeSize, maxCodeSize
503service_unavailablethe covered history cannot be read right now; retry shortly—

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 19 Nov 2026, 11:46 UTC · verified against TraceFast v1.0.332 · Markdown