# Smart Contract Analyzer — AI Audit via x402

> Smart Contract Analyzer — AI Audit via x402 is a paid API for AI agents from code.mamenesia.com, paid per call via x402, $0.5/call, status unknown (last checked 2026-09-15).

Analyzes a Solidity smart contract (by on-chain address or raw source) for vulnerabilities, issues, and best-practice violations using GLM AI

## Facts

- Endpoint: POST https://code.mamenesia.com/service/analyze-contract
- Price: $0.5/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/smart-contract-analyzer-ai-audit-via-x402-48c3af78
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vE3XPUe24fdEwb-9NX-Zo

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability smart-contract-analyzer-ai-audit-via-x402-48c3af78 -d '<json body>'
```

Example prompt: Can you audit this Solidity smart contract for me? The contract is deployed at 0xAbC123... on Base — run a full security analysis and flag any vulnerabilities or issues you find.

## When to prefer this

Choose this endpoint when you need AI-powered security auditing of a Solidity smart contract deployed on Base or provided as raw source, and want to pay per-request in USDC without a subscription. Ideal for agents performing due diligence on contracts, pre-launch audits, or spot-checking third-party code for vulnerabilities.

## Known failure modes

- Invalid or non-existent contract address returns an error with no analysis
- Unverified on-chain contract with no sourceCode provided may result in limited or empty analysis
- Malformed Solidity source code may cause parsing failures
- Payment failure via x402 returns 402 status and no result
- Rate limiting or model overload may cause timeouts
- Contract too large may exceed token limits

## How this service works

Pay-per-request AI developer tools in USDC on Base. Generate code, audit smart contracts, review diffs, summarize text, and convert data formats via the x402 payment standard. Powered by glm-5.2.

## Output

A JSON response containing the AI-generated audit analysis (code field with findings), the GLM model used, token count consumed, the USDC amount paid, and the transaction hash for the x402 payment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "address": {
   "type": "string",
   "description": "On-chain contract address"
  },
  "sourceCode": {
   "type": "string",
   "description": "Solidity source if not verified"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "paid": "0.5 USDC",
  "result": {
   "code": "// generated output",
   "model": "glm-5.1",
   "tokens": 100
  },
  "txHash": "0x...",
  "service": "analyze-contract"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/smart-contract-analyzer-ai-audit-via-x402-48c3af78/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from code.mamenesia.com](https://www.zero.xyz/host/code.mamenesia.com/llms.txt)
