Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
Overview
Transaction simulation lets you execute contract calls and estimate gas without broadcasting to the network. This catches errors early, prevents wasted gas on reverted transactions, and enables building safer dApps.Using eth_call to Simulate
eth_call executes a transaction locally against the current blockchain state without creating an on-chain transaction.
Simulating Against Different Blocks
Estimating Gas
eth_estimateGas returns the gas needed for a transaction to succeed. Always add a buffer for production.
Estimate with Value Transfer
Estimate Contract Deployment
Detecting Revert Reasons
When a call reverts, the RPC returns an error with the revert data. Voltaire providesRevertReason to decode it.
Common Panic Codes
| Code | Description |
|---|---|
| 0x01 | Assertion failed |
| 0x11 | Arithmetic overflow/underflow |
| 0x12 | Division by zero |
| 0x21 | Invalid enum value |
| 0x22 | Storage corruption |
| 0x31 | Pop on empty array |
| 0x32 | Array index out of bounds |
| 0x41 | Too much memory allocated |
| 0x51 | Zero-initialized function pointer |
Decoding Custom Errors
Simulating State Changes
Combineeth_call with state overrides to simulate how a transaction would affect balances and storage.
Check Balance After Transfer
Using Access Lists for Optimization
eth_createAccessList generates an access list showing which addresses and storage slots a transaction will touch.
Complete Simulation Example
Related
- Contract Call Methods - eth_call, eth_estimateGas reference
- Error Handling - Handling RPC errors
- Usage Patterns - Common provider recipes

