$ man contract-source
/contract-source(1)
PRICE / CALL
$0.01
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
edgemarketCATEGORY
uncategorized
STATUS
● live
NAME
contract-source — verified contract source code / etherscan source / contract abi fetcher / solidity source lookup
synonym alias of contract-source-verified — reuses the canonical handler.
SYNOPSIS
POST https://x402.org/v1/contract-source
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
Verified contract source code / Etherscan source / contract ABI fetcher / Solidity source lookup. For any deployed contract on Ethereum, Base, Optimism, Arbitrum, or Polygon: returns is_verified, contract name, compiler version, parsed ABI, full source, license, optimizer settings, constructor args, and proxy implementation address.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| address | string | 0x-prefixed 20-byte EVM contract address. | required |
| chain | string | EVM chain. Default 'base'. Other supported: 'ethereum', 'polygon', 'arbitrum', 'optimism'. enum: base · ethereum · polygon · arbitrum · optimism | optional |
OUTPUT — response shape
| field | type | description |
|---|---|---|
| address | string | Contract address that was queried, as a 0x-prefixed hex string. |
| chain | string | Chain the contract lives on (ethereum, base, optimism, arbitrum, or polygon). |
| is_verified | string | Boolean string indicating whether source code is verified on the chain's block explorer. |
| name | string | Contract name as declared in the verified Solidity source. |
| compiler_version | string | Solidity compiler version used to build the verified contract (e.g. v0.8.20+commit.a1b79de6). |
| abi | string | Parsed contract ABI as a JSON string describing functions, events, and errors. |
| source_code | string | Full verified Solidity source code, single-file or multi-file JSON standard input. |
| license | string | SPDX license identifier declared in the verified source (e.g. MIT, GPL-3.0, UNLICENSED). |
| optimization | string | Optimizer settings used at compile time, including enabled flag and runs count. |
| constructor_arguments | string | ABI-encoded constructor arguments supplied at contract deployment, as a hex string. |
| proxy | string | Implementation address if the contract is a proxy, otherwise null or zero address. |
| source | string | Block explorer the verified source was fetched from (e.g. etherscan, basescan, arbiscan). |
EXAMPLES — two ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.org/v1/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 once claude mcp add x402 --command "npx x402-deployer-mcp" # then ask Claude Code: # "use the contract-source tool to ..."
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
ADJACENT — other endpoints in edgemarket
| endpoint | description | price |
|---|---|---|
| contract-source-verified | Verified contract source code / Etherscan source / Basescan ABI / Solidity source lookup / contract verification check / ABI fetcher / Et… | $0.01 |
| dex-liquidity-depth | DEX liquidity depth / pool TVL aggregator / total liquidity per token / on-chain liquidity audit. | $0.01 |
| eth-logs | eth_getLogs / on-chain event logs / EVM event reader / Transfer event scan / ERC20 Transfer logs / NFT mint logs / DEX swap events / mult… | $0.01 |
| lp-lock-check | LP lock check / liquidity-lock auditor / Unicrypt + Team Finance + burn-address detection. | $0.01 |
| nft-floor | NFT collection floor + recent sales via Reservoir. | $0.01 |
| agent-card-resolve | Agent card resolver / ERC-8004 Identity Registry lookup / Trustless Agents / agentId → owner + agentURI / A2A identity / agent.json fetch… | $0.005 |
| arbitrage-spread | Cross-exchange arbitrage spread / max-min price / CEX price dispersion / spread % calculator. | $0.005 |
| basename-resolve | Basename resolver / Coinbase Basenames / .base.eth lookup / Base name service / on-chain name resolution. | $0.005 |
SEE ALSO