Skip to content
clusters: prooflayer · edgemarket · edgefinance · synthforge · mediakit · wordmint · webprobe · locale · comppoint · rollforge · bestiary · statline · matchpoint · retail · agentops · browserworkflow · modelrouter · compose
$ man contract-source

/contract-source

agentutility / edge-market / contract-source
PRICE / CALL
$0.01
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
edgemarket
CATEGORY
uncategorized
STATUS
live
NAME
contract-source returns verified source code and abi for any deployed contract on ethereum, base, optimism, arbitrum, or polygon
synonym alias of contract-source-verified — reuses the canonical handler.
SYNOPSIS
POST https://x402.agentutility.ai/contract-source
     Content-Type: application/json
     X-PAYMENT:    <signed-transferWithAuthorization>

     { ... }
↳ first call → 402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.
DESCRIPTION

Returns verified source code and ABI for any deployed contract on Ethereum, Base, Optimism, Arbitrum, or Polygon. Includes is_verified, contract name, compiler version, parsed ABI, full source, license, optimizer settings, constructor args, and proxy implementation address. Use it as an Etherscan source lookup, contract ABI fetcher, or Solidity source lookup.

INPUTrequest schema
propertytypedescriptionreq?
addressstring0x-prefixed 20-byte EVM contract address.required
chainstringEVM chain. Default 'base'. Other supported: 'ethereum', 'polygon', 'arbitrum', 'optimism'.
enum: base · ethereum · polygon · arbitrum · optimism
optional
OUTPUTresponse shape
fieldtypedescription
addressstringContract address that was queried, as a 0x-prefixed hex string.
chainstringChain the contract lives on (ethereum, base, optimism, arbitrum, or polygon).
is_verifiedstringBoolean string indicating whether source code is verified on the chain's block explorer.
namestringContract name as declared in the verified Solidity source.
compiler_versionstringSolidity compiler version used to build the verified contract (e.g. v0.8.20+commit.a1b79de6).
abistringParsed contract ABI as a JSON string describing functions, events, and errors.
source_codestringFull verified Solidity source code, single-file or multi-file JSON standard input.
licensestringSPDX license identifier declared in the verified source (e.g. MIT, GPL-3.0, UNLICENSED).
optimizationstringOptimizer settings used at compile time, including enabled flag and runs count.
constructor_argumentsstringABI-encoded constructor arguments supplied at contract deployment, as a hex string.
proxystringImplementation address if the contract is a proxy, otherwise null or zero address.
sourcestringBlock explorer the verified source was fetched from (e.g. etherscan, basescan, arbiscan).
EXAMPLEStwo ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.agentutility.ai/contract-source \
  -H 'Content-Type: application/json' \
  -d '{ }'
first response = 402 Payment Required with payment requirements; sign + retry with X-PAYMENT.
EXAMPLE 2 · mcp
# Install the MCP package for this endpoint's cluster
npx -y @agentutility/mcp-<cluster>

# Required: EVM private key with USDC on Base
export X402_PRIVATE_KEY=0x...

# Then call the contract-source tool from your MCP-aware agent.
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
tags
edge-marketcontract-sourceetherscanabisolidityverified-contractsproxy-implementationcontract-abi
methods
POST
cluster
edgemarket
price
$0.01 USDC per call
ADJACENTother endpoints in edgemarket
endpointdescriptionprice
contract-source-verifiedFetches verified contract source code and ABI for a deployed contract on Ethereum, Optimism, Polygon, Base, or Arbitrum.$0.01
dex-liquidity-depthMeasures DEX liquidity depth by summing TVL across every DefiLlama-tracked yield pool holding a given ERC-20 on Ethereum, Base, Polygon,…$0.01
eth-logsReads on-chain event logs with generic eth_getLogs queries across Base, Ethereum, Arbitrum, Optimism, Polygon, and BSC via public no-auth…$0.01
lp-lock-checkChecks whether an LP token's liquidity is locked, useful for detecting rug-pull risk before swapping into a new pair.$0.01
nft-floorGets an NFT collection's floor price and recent sales via Reservoir.$0.01
agent-card-resolveResolves an ERC-8004 agentId to its on-chain owner, agentURI, and agent card JSON.$0.005
arbitrage-spreadFinds the cross-exchange arbitrage spread for any CoinGecko-listed coin.$0.005
basename-resolveResolves Coinbase Basenames (.base.eth) to Ethereum addresses and back, reading the Base mainnet L2 Resolver on-chain (no gas, no wallet).$0.005
SEE ALSO
agentutility · edgemarket · x402 · mcp · llms.txt · registry.json · bazaar.x402.org