{"uid":"cap_L8X704gYJ5b8vfypUovEC","slug":"4byte-function-selector-lookup-492274b2","name":"4byte Function Selector Lookup","description":"Pay-per-call tools for AI agents. USDC on Base or Solana via x402 v2; no keys, no accounts.","url":"https://api.gptshopltd.com/v1/evm/4byte?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["selector"],"properties":{"selector":{"type":"string","description":"4-byte function selector (0x + 8 hex chars) or full calldata; only the first 4 bytes are used"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"best":"transfer(address,uint256)","count":6,"found":true,"matches":[{"name":"transfer","sources":["sourcify","4byte.directory"],"signature":"transfer(address,uint256)","verifiedContract":true}],"selector":"0xa9059cbb"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OpMuiIFBh6GV_RhWYQbH7","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Resolves a 4-byte EVM function selector (or full calldata) to its human-readable Solidity function signature(s)","exampleAgentPrompt":"What Solidity function does the 4-byte selector 0xa9059cbb correspond to? Look it up against the 4byte.directory registry.","exampleUseCases":[{"title":"Decode unknown transaction calldata","prompt":"I'm looking at an Ethereum transaction and the input data starts with 0x23b872dd — can you tell me what smart contract function that selector maps to?"},{"title":"Verify ABI signature during audit","prompt":"We're auditing a contract interaction and need to confirm what function 0x70a08231 resolves to — can you check the 4byte registry and tell me the full Solidity signature?"},{"title":"Label MEV bot transaction function","prompt":"This MEV transaction has calldata beginning with 0xe8e33700 — look up what function that is so I can understand what operation it was performing."}],"resultDescription":"Returns a JSON object with the best-matching human-readable Solidity function signature, the total count of matches found, a boolean indicating whether any match was found, a list of match objects each containing function name, full signature, source registries (e.g. 4byte.directory, Sourcify), and whether it comes from a verified contract, plus the original selector queried.","failureModes":["Selector not found in registry — returns found:false with empty matches array","Malformed selector (not 0x-prefixed or wrong length) — likely 400 or validation error","Multiple ambiguous matches with no clear best — returns count>1 but may not reliably identify the intended function","Payment not processed via x402 — 402 response before result is returned"],"whenToPreferThis":"Use this endpoint when you need to decode an unknown EVM function selector or raw calldata prefix into a human-readable Solidity function signature, especially during transaction analysis, smart contract auditing, or MEV research. It aggregates multiple sources including 4byte.directory and Sourcify and flags verified contracts, making it more reliable than querying a single registry. No API key or account setup required — pay per call via USDC on Base or Solana.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T06:36:53.679Z","isFirstParty":false,"canonicalSlug":"4byte-function-selector-lookup-492274b2"}