eth_simulateV1
Simulates one or more transaction bundles against Base state, including Flashblocks preconfirmed state. Returns simulated block results with call status, gas used, return data, logs, and errors — without broadcasting anything onchain.
Use Cases#
- Transaction preview — Verify a swap or transfer will succeed before sending
- Multi-call simulation — Simulate a sequence of dependent transactions atomically
- State override testing — Override account balances or contract storage for what-if analysis
- Gas estimation — Get precise gas usage for complex call sequences
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
simulatePayload | Object | Yes | Object containing blockStateCalls, traceTransfers, and validation |
blockTag | QUANTITY|TAG | Yes | Block number in hex, or "latest", "pending" |
simulatePayload Fields#
| Field | Type | Description |
|---|---|---|
blockStateCalls | Array | Array of block objects, each containing calls (array of transaction objects), optional stateOverrides, and optional blockOverrides |
traceTransfers | Boolean | If true, trace ETH transfers during simulation |
validation | Boolean | If true, run additional validation checks |
Request#
{
"jsonrpc": "2.0",
"method": "eth_simulateV1",
"params": [
{
"blockStateCalls": [
{
"calls": [
{
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"data": "0x70a08231000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}
]
}
],
"traceTransfers": true,
"validation": false
},
"latest"
],
"id": 1
}
Returns#
An array of simulated block results, each containing:
| Field | Type | Description |
|---|---|---|
number | QUANTITY | Simulated block number |
hash | DATA | Simulated block hash |
gasUsed | QUANTITY | Total gas used |
calls | Array | Array of call results |
Call Result Fields#
| Field | Type | Description |
|---|---|---|
status | QUANTITY | 0x1 for success, 0x0 for revert |
returnData | DATA | ABI-encoded return data |
gasUsed | QUANTITY | Gas consumed by this call |
logs | Array | Logs emitted during simulation |
error | Object | Error details if call reverted |
Code Examples#
- cURL
- JavaScript
- Python
curl -X POST https://api-base-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_simulateV1",
"params": [
{
"blockStateCalls": [
{
"calls": [
{
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"data": "0x70a08231000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}
]
}
],
"traceTransfers": true,
"validation": false
},
"latest"
],
"id": 1
}'
const response = await fetch(
'https://api-base-mainnet-archive.n.dwellir.com/YOUR_API_KEY',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_simulateV1',
params: [
{
blockStateCalls: [
{
calls: [
{
from: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
to: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
data: '0x70a08231000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
},
],
},
],
traceTransfers: true,
validation: false,
},
'latest',
],
id: 1,
}),
}
);
const data = await response.json();
for (const block of data.result) {
for (const call of block.calls) {
console.log('Status:', call.status === '0x1' ? 'success' : 'reverted');
console.log('Gas used:', parseInt(call.gasUsed, 16));
console.log('Return data:', call.returnData);
}
}
import requests
response = requests.post(
'https://api-base-mainnet-archive.n.dwellir.com/YOUR_API_KEY',
json={
'jsonrpc': '2.0',
'method': 'eth_simulateV1',
'params': [
{
'blockStateCalls': [
{
'calls': [
{
'from': '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'to': '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
'data': '0x70a08231000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
}
]
}
],
'traceTransfers': True,
'validation': False
},
'latest'
],
'id': 1
}
)
result = response.json()['result']
for block in result:
for call in block['calls']:
print(f"Status: {'success' if call['status'] == '0x1' else 'reverted'}")
print(f"Gas used: {int(call['gasUsed'], 16)}")
print(f"Return data: {call['returnData']}")
Response Example#
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"number": "0x29442bb",
"hash": "0xcefc6e6e...",
"gasUsed": "0x79ce",
"calls": [
{
"returnData": "0x00000000000000000000000000000000000000000000000000000000011420f9",
"logs": [],
"gasUsed": "0x79ce",
"status": "0x1"
}
]
}
]
}
Error Handling#
| Error Code | Message | Description |
|---|---|---|
| -32602 | Invalid params | Malformed simulation payload |
| -32000 | Execution reverted | One or more simulated calls reverted |
Related Methods#
eth_call— Execute a single read-only calleth_estimateGas— Estimate gas for a transactioneth_sendRawTransactionSync— Send a transaction and wait for Flashblock inclusion
Need help? Contact our support team or check the Base documentation.