evm_code · EVM code
read-onlyUse when you need to know whether an address is a contract on Base, Ethereum, Arbitrum, Polygon or Optimism: is_contract, bytecode size, sha256 of the bytecode. Returns the paid x402 request for your input (GET /evm/code, $0.002 per call; schema linked). Call that URL with an x402 or MPP client to get the data. Bad input is refused before any charge. Contract check with bytecode size and hash only; for the coin balance use evm_native_balance, for the transaction count use evm_nonce. First call each day returns the data itself, free; later calls return the paid request.
Input schema
{
"type": "object",
"properties": {
"address": {
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$",
"description": "Address to test for contract code (0x + 40 hex); a plain account returns is_contract=false"
},
"chain": {
"type": "string",
"enum": [
"ethereum",
"base",
"arbitrum",
"polygon",
"optimism"
],
"default": "base",
"description": "Chain; default base"
}
},
"required": [
"address"
]
}