How to simulate a transaction before signing

How to simulate a transaction before signing it, using wallet previews, Safe and Tenderly, what a simulation shows and what it cannot promise.

Published · Updated · Last verified · Tools

To simulate a transaction before signing, run it against current chain state without broadcasting it. A wallet that previews the transaction, a Safe Wallet confirmation screen or Tenderly’s simulator will each show the balance changes and any revert reason first, and you sign only if the result matches what you expected.

A transaction simulation is a dry run of a transaction against the chain’s current state that returns the result without sending anything to the network.

This guide covers where you meet a simulation, the steps to read one and what the official pages say it cannot promise. It is educational, not security or investment advice.

What is a transaction simulation?

A simulation executes a transaction on a node or a replica of the chain and reports what would happen, with no transaction created. The base mechanism is the eth_call method of Ethereum’s JSON-RPC API.

The ethereum.org JSON-RPC page describes eth_call as executing “a new message call immediately without creating a transaction on the blockchain.” It takes a call object with a to address and optional from, gas, value and input fields. A second parameter sets the block at which state is read, such as a block number or the tag latest. The page says eth_call consumes zero gas.

Wallets and tools build on this idea and add decoding. Instead of raw return data, they show token movements and readable errors.

Where do you meet a simulation before signing?

Wallet confirmation screens and Safe Wallet’s transaction flow carry one, and Tenderly offers its own simulator. Each project describes its own version.

Where What its own pages describe Where it appears
Rabby A preview that translates a transaction into readable terms, with balance changes and risk flags Signing screen
MetaMask Estimated balance changes for contract interactions, covering ERC-20 tokens and ERC-721 and ERC-1155 NFTs Confirmation screen
Safe Wallet A step-by-step preview of likely outcomes from Tenderly, built into the wallet Transaction flow before confirming
Tenderly A simulator that runs a transaction in a replica of the blockchain, through the REST API, RPC or SDK API, RPC, SDK and Tenderly’s tools

Rabby’s support page says the preview lets you compare the result with what the site says it is doing, so you can catch a mismatch before signing. MetaMask’s support page says “Basic Functionality” must be enabled under Settings and Privacy for the feature to work.

Safe is a smart account where a threshold of owners must confirm a transaction. Its help article on Tenderly and Blockaid says Tenderly is incorporated directly in the wallet and gives a step-by-step preview of likely outcomes before you confirm. The article does not describe the steps to start it, so open a pending transaction in the wallet and look at the confirmation screen.

Tenderly describes its transaction simulator as predicting a transaction’s outcome before it runs, in “a replica of the real blockchain.” Its transaction preview page describes the same simulation used inside wallets to show likely outcomes before signing.

How do you simulate a transaction before you sign it?

Follow the preview your tool gives you, and read it before you press sign. These steps apply to wallet previews, Safe and Tenderly alike.

  1. Start the action on the site as usual, such as a swap, a deposit or an approval. Stop at the wallet’s confirmation screen and do not sign yet.
  2. Check that the simulation or preview loaded. In MetaMask it depends on a setting; if it is off, you will see no estimate. If a preview is missing, treat that as missing information, not as a pass.
  3. Read the balance changes. Look at what leaves your account, what arrives and in which token. Rabby’s page describes this as what will leave your wallet and what you are expected to receive.
  4. Compare the result with the site’s wording. If the site says “swap” and the preview shows a transfer to another address, stop.
  5. Check approvals and signatures. Rabby’s page says token approvals, and gasless signatures such as Permits, are scanned because they can still move funds. Look at the spender address and the amount.
  6. Read any warning. Rabby’s page says that when a risk is detected the Sign button is disabled until you review each warning, and that choosing “Ignore All” is at your own risk.
  7. If the simulation fails, read the reason. Rabby’s page says “Simulation Failed” means the transaction will likely fail onchain, usually because of a contract error, and advises not forcing it. Tenderly’s docs say its simulator decodes complex errors into plain-language explanations.
  8. On a Safe, have each owner read the preview before confirming. A threshold account runs only when enough owners confirm, so each confirmation is a point to check.
  9. Sign only if every line matches what you intended. If anything differs, reject the request and check the contract on a block explorer.

What does a simulation show?

Balance changes, approvals, gas and the reason a transaction would fail; the exact list differs by tool.

Tenderly’s docs list asset and balance changes, a decoded trace, a gas usage breakdown, storage updates, access lists of the addresses and storage slots touched, and decoded errors. The transaction preview page adds decoded events and results for bundled simulations of multi-step actions such as swaps. Its dollar values are based on CoinGecko prices, per the same page.

Wallets show less. MetaMask’s page describes estimated balance changes to your account. Rabby’s page describes balance changes plus flags for token approvals, asset swaps with high price impact, and scam tokens.

Tenderly’s simulator also supports state overrides, which change conditions such as timestamps and contract data to test other scenarios. If a result was produced with overrides, it describes a changed world, not the live one.

What can a simulation not tell you?

It cannot promise that the real transaction will behave the same way. MetaMask’s support page says standard simulations carry no promise of matching what happens onchain, and that offchain simulations can be exploited by red-pill attacks.

The MetaMask page describes a separate feature, Added protection, which runs enforced simulations onchain on supported networks and adds gas cost. MetaMask also says the simulation feature relies on a centralized MetaMask server.

Timing is the other gap. A simulation reads state at the block you choose, such as latest in the eth_call description. The real transaction is included in a later block, and the state it meets can be different. None of the pages above promise otherwise.

A simulation also shows effects, not intentions. It reports what a call would do to balances and storage at that moment. The official pages describe previews, warnings and decoded results. They do not describe a simulation as a judgement on whether a contract’s author is honest, so a contract can show a clean preview and still hold risks that only an audit, a code review or a track record would show.

Tenderly’s simulator page makes its own accuracy claim about the gas breakdown. It lists no limits for balance changes or for state differences at execution time.

What should you check besides the simulation?

Check the contract address, the spender in any approval and the network. A preview works on the data it is given, so the address you interact with matters before the simulation runs.

  • The contract address, against the project’s own docs, on a block explorer such as Etherscan.
  • The spender and the amount in any approval or Permit.
  • Whether the preview came from your wallet or from a link the site gave you.
  • For a Safe, that every owner sees the same transaction before confirming.
  • Our tools category lists other tools for reading contracts and onchain data.

Questions

Does simulating a transaction cost gas?
The ethereum.org page on the JSON-RPC API says eth_call consumes zero gas, because it runs a call without creating a transaction on the blockchain. Wallet previews and Tenderly's simulator work the same way from the user's side, since nothing is sent to the network.
Can a simulation be wrong?
Yes. MetaMask's support page says standard simulations carry no promise of matching what happens onchain. A simulation reads the chain at one moment, and the real transaction runs later.
What does Simulation Failed mean?
Rabby's support page says it means the transaction will likely fail onchain, usually because of an error in the smart contract. The page advises against forcing it through.
Does a clean simulation mean a contract is safe?
The official pages do not say so. They describe a simulation as a preview of balance changes, gas and errors, not as a verdict on who wrote the contract or what it intends.

Sources

  1. JSON-RPC API, ethereum.orgaccessed
  2. Transaction simulator, Tenderly docsaccessed
  3. Transaction preview, Tenderly docsaccessed
  4. Understanding Rabby's transaction simulation, Rabby supportaccessed
  5. What are transaction simulations, MetaMask supportaccessed
  6. Safe Wallet security with Tenderly and Blockaid, Safe Help Centeraccessed