# EVM Transaction Simulator (Pre-Signing Safety)

> EVM Transaction Simulator (Pre-Signing Safety) is a paid API for AI agents from evm-tx-toolkit.mtree.workers.dev, paid per call via x402, $0.200000/call, status unknown (last checked 2026-09-15).

Simulates an EVM transaction before broadcasting to check success/revert status, decoded revert reason, gas estimate, return data, approval risk, value movements, and balance changes across Base, Ethereum, Arbitrum, Optimism, and Polygon.

## Facts

- Endpoint: POST https://evm-tx-toolkit.mtree.workers.dev/tools/tx_simulator
- Price: $0.200000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-tx-toolkit-mtree-workers-dev-fbc15e8c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_A7T4XPTuafNc9YCWaXS0F

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 evm-tx-toolkit-mtree-workers-dev-fbc15e8c -d '<json body>'
```

Example prompt: Before I sign this transaction, can you simulate it on Base to check if it will succeed, estimate the gas, flag any approval risks, and show me what balance changes to expect? The sender is 0xAbC...123, calling contract 0xDef...456 with this calldata: 0xa9059cbb...

## When to prefer this

Use this endpoint when you need to pre-flight check a transaction before signing or broadcasting — especially for DeFi interactions, token approvals, or contract calls where reverts or unexpected approvals would be costly. Prefer this over just estimating gas when you also need revert reason decoding, balance change previews, and approval risk assessment in a single call across Base, Ethereum, Arbitrum, Optimism, or Polygon.

## Known failure modes

- Invalid or malformed calldata returns a parse/validation error
- Unsupported chain ID returns an error indicating the chain is not supported
- Simulation times out for complex multi-hop calls
- Contract not deployed at the given address returns a revert or null result
- Missing required fields (sender, to, data) returns a 400-level error
- Network RPC issues cause simulation to fail with a connectivity error

## How this service works

EVM transaction simulation for pre-signing safety. Simulate a call before broadcasting on Base, Ethereum, Arbitrum, Optimism, or Polygon and return success/revert status, decoded revert reason, estimated gas, return data, approval risk, value movement hints, and likely balance changes. Returns JSON. Price 0.20 USDC on Base via x402. Demo/preview: https://evm-tx-toolkit.mtree.workers.dev/demo/tx/simulate. Contact: https://evm-tx-toolkit.mtree.workers.dev/contact.

## Output

A JSON object containing: success or revert status, decoded revert reason if applicable, estimated gas units, raw return data, approval risk flags (e.g. unlimited approvals), value movement hints, and predicted token/ETH balance changes for involved addresses — all before the transaction is actually submitted to the chain.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "chain",
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "example": "0x0000000000000000000000000000000000000000",
       "description": "target contract"
      },
      "data": {
       "type": "string",
       "example": "0x",
       "description": "calldata hex"
      },
      "from": {
       "type": "string",
       "example": "0x0000000000000000000000000000000000000000",
       "description": "msg.sender address for pre-signing simulation"
      },
      "block": {
       "type": "string",
       "example": "latest",
       "description": "block tag or block number"
      },
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "arbitrum",
        "optimism",
        "polygon"
       ],
       "type": "string",
       "example": "base"
      },
      "value": {
       "type": "string",
       "example": "0",
       "description": "wei value"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "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/evm-tx-toolkit-mtree-workers-dev-fbc15e8c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from evm-tx-toolkit.mtree.workers.dev](https://www.zero.xyz/host/evm-tx-toolkit.mtree.workers.dev/llms.txt)
