# Base Onchain Tools – Simulate Token Transfer

> Base Onchain Tools – Simulate Token Transfer is a paid API for AI agents from base-onchain-tools.dolerite.workers.dev, paid per call via x402, $0.008/call, status unknown (last checked 2026-10-13).

Simulates an ERC-20 or native token transfer on Base mainnet and returns whether it would succeed or revert, with the exact revert reason and a human-readable list of blockers.

## Facts

- Endpoint: GET https://base-onchain-tools.dolerite.workers.dev/v1/base/simulate-transfer?utm_source=zero.xyz
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-onchain-tools-simulate-token-transfer-015af43d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jqTvS4YEGwHTxfCbF-yIe

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 base-onchain-tools-simulate-token-transfer-015af43d
```

Example prompt: Before I send 500 USDC from 0xAbC...123 to 0xDeF...456 on Base, simulate the transfer and tell me if it would succeed or exactly why it would revert.

## When to prefer this

Use this endpoint when you need a cheap, reliable pre-flight check before submitting a token transfer on Base mainnet — especially in payment pipelines, bots, or user-facing UIs where a reverting transaction would waste gas or cause confusion. It is purpose-built for Base mainnet reads with no API key or account required, costs only $0.008 per call (billed only on success), and returns machine-parseable revert reasons plus human-readable blockers. Prefer it over raw eth_call simulation when you want structured, interpreted results rather than raw hex revert data.

## Known failure modes

- Malformed or missing `from`, `to`, or `amount` parameters returns a 4xx error (not billed)
- Invalid ERC-20 contract address causes upstream call failure (not billed)
- Upstream RPC provider outage across all five providers causes a 5xx (not billed)
- Incomplete batch result treated as failure rather than partial data (not billed)
- Amount expressed in decimal instead of atomic units may produce misleading results (user error)

## How this service works

Eleven read-only endpoints answering questions about Base mainnet that are tedious to assemble from raw RPC: what an unverified contract is actually able to do, whether a token transfer will revert and for what reason, what an arbitrary token is worth, and whether an address is safe to pay. Priced $0.001-$0.04 per call in USDC over x402. No account, no API key, no signup, no minimum, no rate limit to negotiate — the payTo address in the 402 response is the whole integration. Failed calls are not billed. The payment middleware cancels settlement on any 4xx or 5xx, so a malformed parameter or an upstream outage costs nothing. Answers are read live from Base mainnet at request time, with failover across five independent RPC providers. A batch that comes back incomplete is treated as a failure rather than returned with the missing entries as zeros, because a confident wrong answer costs a caller more than an error does. Scope is deliberately narrow: Base mainnet only, reads only, no keys held, nothing stored between requests.

## Output

A JSON object with: `verdict` ('would-succeed' or 'would-fail'), `would_succeed` boolean, `revert` object containing `kind` (e.g. 'Error(string)') and `reason` (the revert message string), and `blockers` — a human-readable array explaining why the transfer would fail (e.g. insufficient balance, missing allowance). On success, `revert` and `blockers` will be absent or empty.

## 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"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "from",
      "to",
      "amount"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "Recipient address"
      },
      "from": {
       "type": "string",
       "description": "Address the tokens leave"
      },
      "token": {
       "type": "string",
       "description": "Optional ERC-20 contract, defaults to USDC on Base"
      },
      "amount": {
       "type": "string",
       "description": "Amount in atomic units (for USDC, 1000000 = $1)"
      },
      "spender": {
       "type": "string",
       "description": "Optional: simulate transferFrom pulled by this spender instead of a direct transfer"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "revert": {
   "kind": "Error(string)",
   "reason": "ERC20: transfer amount exceeds balance"
  },
  "verdict": "would-fail",
  "blockers": [
   "sender holds 0 USDC but is sending 1"
  ],
  "would_succeed": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-onchain-tools-simulate-token-transfer-015af43d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from base-onchain-tools.dolerite.workers.dev](https://www.zero.xyz/host/base-onchain-tools.dolerite.workers.dev/llms.txt)
