# Transaction Simulation (Base Chain Pre-execution Check)

> Transaction Simulation (Base Chain Pre-execution Check) is a paid API for AI agents from 402.com.tr, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-12).

Simulates an unsigned Ethereum transaction against live Base chain state, returning success/revert status, revert reason, gas estimate, ETH cost, and decoded approval risk flags (unlimited approvals, setApprovalForAll) before signing.

## Facts

- Endpoint: GET https://402.com.tr/api/x402/simulate-tx?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/transaction-simulation-base-chain-pre-execution-check-c219406d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_51qvrNTY-XTznDYLMYqTr

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 transaction-simulation-base-chain-pre-execution-check-c219406d
```

Example prompt: Before I sign this transaction, simulate it against live Base state to check if it will succeed or revert — the sender is 0xAbC...123, the contract is 0xDeF...456, and the calldata is 0xa9059cbb... — and flag any unlimited token approvals or setApprovalForAll patterns in the data.

## When to prefer this

Use this endpoint when an AI agent or wallet interface needs a safety gate before prompting a user to sign any Base chain transaction — especially when the calldata involves token approvals, DeFi interactions, or unfamiliar contracts. Prefer this over generic gas estimators when you need approval-type decoding and drain-vector detection in a single call. Ideal for agent-safety playbooks where blocking on revert or unlimited approvals is required before execution.

## Known failure modes

- Missing required 'from' or 'to' parameters — returns 400 error
- Invalid or malformed Ethereum address — returns error response
- Malformed calldata hex — may fail to decode or simulate correctly
- Base RPC node unavailable — simulation cannot be completed
- Transaction simulation gas exceeds block limit — revert with out-of-gas
- Network congestion may cause stale state snapshots

## How this service works

Simulate an UNSIGNED transaction against live Base state before an agent signs: will it SUCCEED or revert (with the contract's own reason), the gas estimate and ETH cost, and — decoded from the calldata — whether it grants an approval, and whether that approval is UNLIMITED (approve/permit) or a setApprovalForAll, the classic drain vectors. Pass from, to, and optionally data (calldata) + value. The pre-execution check the agent-safety playbook says to run and block on. Not financial advice.

## Output

Returns whether the transaction would succeed or revert (with the contract's own revert reason string), a gas estimate and ETH cost, and decoded calldata flags indicating whether the transaction grants a token approval, whether that approval is unlimited (approve/permit style), and whether it uses setApprovalForAll — the classic NFT/ERC20 drain vectors.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "To (recipient/contract)"
      },
      "data": {
       "type": "string",
       "description": "Calldata (hex, optional)"
      },
      "from": {
       "type": "string",
       "description": "Sender address"
      },
      "value": {
       "type": "string",
       "description": "ETH value (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/transaction-simulation-base-chain-pre-execution-check-c219406d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402.com.tr](https://www.zero.xyz/host/402.com.tr/llms.txt)
