Skip to main content

Contract Verification

Verify smart contracts and fetch their ABIs across multiple chains.

Try it Live

Open in Swagger UI โ†’ to test these endpoints interactively.

Endpointsโ€‹

EndpointDescriptionPrice
GET /api/security/contract/{address}Contract verification$0.02
GET /api/abi/{address}Fetch contract ABI$0.01

GET /api/security/contract/{address}โ€‹

Get contract verification status and metadata.

Requestโ€‹

curl "https://api.web3identity.com/api/security/contract/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48?chain=ethereum"

Query Parametersโ€‹

ParameterTypeDefaultDescription
chainstringethereumChain: ethereum, polygon, arbitrum, optimism, base, bsc

Responseโ€‹

{
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain": "ethereum",
"isVerified": true,
"contractName": "FiatTokenV2_1",
"compiler": {
"version": "v0.6.12+commit.27d51765",
"optimization": true,
"runs": 10000000
},
"license": "MIT",
"sourceCode": {
"available": true,
"files": 15,
"mainFile": "FiatTokenV2_1.sol"
},
"proxy": {
"isProxy": true,
"type": "EIP-1967",
"implementation": "0xa2327a938febf5fec13bacfb16ae10ecbc4cbdcf",
"admin": "0x807a96288A1A408dBC13DE2b1d087d10356395d2"
},
"constructor": {
"args": [],
"signature": "constructor()"
},
"createdAt": {
"block": 6082465,
"timestamp": "2018-07-05T12:34:56Z",
"transaction": "0x3c45e..."
},
"audit": {
"verified": true,
"auditors": ["Trail of Bits", "OpenZeppelin"],
"lastAudit": "2023-06-15"
}
}

GET /api/abi/{address}โ€‹

Fetch the ABI (Application Binary Interface) for a verified contract.

Requestโ€‹

curl "https://api.web3identity.com/api/abi/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48?chain=ethereum"

Query Parametersโ€‹

ParameterTypeDefaultDescription
chainstringethereumChain name
implementationbooleanfalseIf proxy, fetch implementation ABI

Responseโ€‹

{
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain": "ethereum",
"contractName": "FiatTokenV2_1",
"abi": [
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_spender",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"functions": {
"total": 45,
"external": 32,
"public": 8,
"internal": 5
}
}

Proxy Typesโ€‹

TypeDescriptionDetection
EIP-1967Transparent proxy standardStorage slot 0x360...33
EIP-1822Universal upgradeable proxyproxiableUUID() function
Gnosis SafeMulti-sig proxymasterCopy storage
BeaconBeacon proxy pattern_beacon storage
MinimalMinimal clone (EIP-1167)Bytecode pattern

SDK Examplesโ€‹

JavaScriptโ€‹

import { Web3IdentityClient } from '@web3identity/sdk';

const client = new Web3IdentityClient();

// Check contract verification
const contract = await client.getContractVerification(
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
{ chain: 'ethereum' }
);

console.log(`Contract: ${contract.contractName}`);
console.log(`Verified: ${contract.isVerified ? 'โœ…' : 'โŒ'}`);
console.log(`Compiler: ${contract.compiler.version}`);

if (contract.proxy.isProxy) {
console.log(`Proxy type: ${contract.proxy.type}`);
console.log(`Implementation: ${contract.proxy.implementation}`);
}

// Fetch ABI
const abi = await client.getContractABI(
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
{ chain: 'ethereum' }
);

console.log(`\nABI Functions: ${abi.functions.total}`);
console.log(`External: ${abi.functions.external}`);

// Find specific function
const transferFunc = abi.abi.find(f => f.name === 'transfer');
console.log('\nTransfer function:', transferFunc);

// For proxies, get implementation ABI
if (contract.proxy.isProxy) {
const implABI = await client.getContractABI(
contract.address,
{ chain: 'ethereum', implementation: true }
);
console.log(`Implementation ABI: ${implABI.functions.total} functions`);
}

Pythonโ€‹

from web3identity import Client

client = Client()

# Check verification status
contract = client.get_contract_verification(
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
chain='ethereum'
)

print(f"Contract: {contract['contractName']}")
print(f"Verified: {'โœ…' if contract['isVerified'] else 'โŒ'}")
print(f"License: {contract['license']}")

if contract['proxy']['isProxy']:
print(f"\n๐Ÿ”„ Proxy detected:")
print(f" Type: {contract['proxy']['type']}")
print(f" Implementation: {contract['proxy']['implementation']}")

# Get ABI
abi = client.get_contract_abi(
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
chain='ethereum'
)

print(f"\nABI has {abi['functions']['total']} functions")

# Extract function signatures
functions = [f['name'] for f in abi['abi'] if f.get('type') == 'function']
print(f"Functions: {', '.join(functions[:10])}...")

cURL Examplesโ€‹

# Check USDC contract on Ethereum
curl "https://api.web3identity.com/api/security/contract/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48?chain=ethereum"

# Check Uniswap V3 Router on Arbitrum
curl "https://api.web3identity.com/api/security/contract/0xE592427A0AEce92De3Edee1F18E0157C05861564?chain=arbitrum"

# Get USDC ABI
curl "https://api.web3identity.com/api/abi/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48?chain=ethereum"

# Get implementation ABI for proxy
curl "https://api.web3identity.com/api/abi/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48?chain=ethereum&implementation=true"

# Check contract on Base
curl "https://api.web3identity.com/api/security/contract/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913?chain=base"

Rate Limitsโ€‹

TierRate LimitNotes
Free100 requests/dayNo payment required
PaidUnlimited$0.01-$0.02 per call via x402

Common Use Casesโ€‹

Proxy Detection & Analysisโ€‹

// Comprehensive proxy analysis
async function analyzeProxy(address, chain = 'ethereum') {
const contract = await client.getContractVerification(address, { chain });

if (!contract.proxy.isProxy) {
console.log('Not a proxy contract');
return;
}

console.log(`Proxy Type: ${contract.proxy.type}`);

// Get both proxy and implementation details
const [proxyABI, implABI] = await Promise.all([
client.getContractABI(address, { chain }),
client.getContractABI(address, { chain, implementation: true })
]);

// Get implementation contract details
const implContract = await client.getContractVerification(
contract.proxy.implementation,
{ chain }
);

return {
proxy: {
address,
name: contract.contractName,
functions: proxyABI.functions.total
},
implementation: {
address: contract.proxy.implementation,
name: implContract.contractName,
functions: implABI.functions.total,
verified: implContract.isVerified
},
admin: contract.proxy.admin
};
}

const analysis = await analyzeProxy('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48');
console.log(analysis);

Multi-Chain Contract Scannerโ€‹

// Check if contract is deployed/verified on multiple chains
async function scanMultiChain(address) {
const chains = ['ethereum', 'polygon', 'arbitrum', 'optimism', 'base'];

const results = await Promise.allSettled(
chains.map(chain =>
client.getContractVerification(address, { chain })
)
);

return chains.map((chain, i) => ({
chain,
deployed: results[i].status === 'fulfilled',
verified: results[i].value?.isVerified || false,
name: results[i].value?.contractName || 'Unknown'
}));
}

const deployment = await scanMultiChain('0x7f5c764cbc14f9669b88837ca1490cca17c31607');
console.log('Multi-chain deployment:', deployment);

ABI Function Extractorโ€‹

// Extract specific function signatures
async function extractFunctions(address, chain, functionNames) {
const abi = await client.getContractABI(address, { chain });

return functionNames.map(name => {
const func = abi.abi.find(f => f.name === name && f.type === 'function');
if (!func) return null;

return {
name: func.name,
inputs: func.inputs.map(i => `${i.type} ${i.name}`),
outputs: func.outputs.map(o => o.type),
stateMutability: func.stateMutability
};
}).filter(Boolean);
}

const functions = await extractFunctions(
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'ethereum',
['transfer', 'approve', 'balanceOf']
);
console.log('Extracted functions:', functions);