{"uid":"cap_05jzRsAOHm1lKTik9o_Xg","slug":"base-mainnet-contract-code-check-d5d28130","name":"Base Mainnet Contract Code Check","description":"Check whether a Base mainnet address is a contract via eth_getCode - returns bytecode size, zero for an externally-owned account.","url":"https://x402.agentindex.world/base/code?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"address":{"type":"string","title":"Address"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-CNLXW88fQa1TiGNW5AM4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Checks whether a Base mainnet address is a smart contract by retrieving its bytecode size via eth_getCode — returns zero for externally-owned accounts (EOAs).","exampleAgentPrompt":"Is the address 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on Base mainnet a smart contract or a regular wallet? Check its bytecode and tell me if it has deployed code.","exampleUseCases":[{"title":"Verify token contract before swap","prompt":"Before I swap into this Base token at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, can you confirm it's actually a deployed smart contract and not just a random wallet address?"},{"title":"Detect EOA in airdrop recipient list","prompt":"I have a recipient address 0x4200000000000000000000000000000000000006 on Base — check whether it's a smart contract or a plain externally-owned account before we include it in the airdrop."},{"title":"Due diligence on unknown Base address","prompt":"Someone sent me a Base address 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD and claimed it's a DEX router contract — can you verify it actually has bytecode deployed on Base mainnet?"}],"resultDescription":"Returns the bytecode size (in bytes) for the given Base mainnet address — a non-zero value indicates a deployed smart contract, while zero indicates a plain externally-owned account (EOA) with no code.","failureModes":["Invalid or malformed Ethereum address returns an error","Address not found on Base mainnet returns zero (indistinguishable from EOA at undeployed address)","Network or RPC node errors may cause timeouts","Payment failure via x402 protocol blocks the call"],"whenToPreferThis":"Use this endpoint when you need a lightweight, single-call check to determine if a Base mainnet address is a smart contract versus a regular wallet, without needing full ABI decoding or contract interaction. It is faster and cheaper than fetching full transaction history and is ideal for pre-flight validation before token swaps, airdrops, or contract interactions on Base L2.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T12:39:01.079Z","isFirstParty":false,"canonicalSlug":"base-mainnet-contract-code-check-d5d28130"}