Transaction Simulation Before Signing: What a Wallet Preview Can Miss
Modern wallets simulate a transaction before you sign and show what your balance would do. It is a genuine improvement over a blank confirmation screen, and it is not a guarantee. A simulation is a prediction made against one version of state, and the block that includes your transaction can differ from it. This guide separates what the preview proves from what it merely suggests.

Cover artwork: CoinSoso · AI-generated, not a photograph of a real venue, product or market capture.
Key takeaways
- A standard simulation runs offchain against a copy of chain state; it does not execute on the blockchain and cannot bind the real transaction.
- Balance-diff previews show assets moving, not permissions granted; an unlimited approval can leave the preview looking almost harmless.
- A contract can detect that it is being simulated and behave differently, which is the basis of the red-pill attack.
- State changes between the simulated block and the inclusion block can make a passing simulation revert in execution.
- Enforced, onchain simulation is different in kind: it makes the transaction revert if execution does not match the simulation, and it costs more gas.
What the preview actually is
When a wallet simulates a transaction, it executes the call against a copy of blockchain state and reports the result — typically the balance changes that would occur, and sometimes a decoded description of the call. MetaMask describes its standard simulations as “a test run of your transaction” that predicts estimated balance changes so you can see the outcome before submitting.
The copy is the important word. A standard simulation does not create a transaction on the blockchain. The Geth documentation describes eth_call as executing a message call immediately without creating a transaction, and eth_simulateV1 as simulating transactions without creating them. Both can run against a specified block and, optionally, a modified state.
That gives the preview three properties worth keeping separate:
- It is a prediction, computed from one version of state.
- It is offchain by default, so nothing about it is binding.
- It runs with a caller and block context that a real transaction may not share.
Everything a preview can miss follows from one of those three.
The gap between simulated and real state
A simulation answers: what would happen if this transaction executed against block N, in this order, with this gas? The real transaction executes against block N+k, in an order determined by the block builder, with the gas actually forwarded.
Between the preview and the execution, other transactions land. A pool’s reserves change, an oracle updates, a lending market’s utilisation moves, a token’s balance is transferred. Any contract check that depends on those values can flip.
The most common form is a slippage check on a swap. The simulation shows the output at the current pool state. A pending trade executes first, moves the price, and the minimum-output check fails. The transaction reverts. You pay gas and receive nothing.
That is not a malfunction of simulation; it is a correct simulation of a state that no longer exists at inclusion time.
The approval that the balance diff does not show
Balance-diff previews are built around what moves. An approval does not move anything. It grants a right.
Consider a transaction that calls two functions on a contract: an ERC-20 approve for an unlimited amount to a spender, followed by a deposit of 100 USDC.
The preview shows:
| Asset | Change |
|---|---|
| USDC | −100.00 |
| ETH (gas) | −0.0021 |
That reads as a small, bounded payment. But the approval granted the spender the right to transfer the wallet’s entire USDC balance at any time in the future. If the wallet holds 25,000 USDC, the transaction has authorised access to 250 times the amount the preview showed leaving.
The simulation was accurate about balances. It was silent about authority, because authority is not a balance. This is the same distinction that separates clear signing from blind signing: the question is not only what the bytes do now, but what they authorise later.
The contract that knows it is being watched
MetaMask’s documentation describes the red-pill attack directly. Standard simulations run in a controlled environment, and a malicious contract can detect that environment and respond differently. During simulation it behaves harmlessly — the preview shows a safe outcome — and during real execution it behaves maliciously.
The detection can be as simple as checking the caller’s identity, the gas left, the block number, or whether a particular transaction is present in the block. A simulation is a call, not a signed transaction; the environment differs in ways a contract can observe.
This is why MetaMask introduced what it calls enforced simulations. With that setting, the transaction is simulated and then executed onchain with the simulation conditions enforced: if real execution does not match what was simulated, the transaction reverts. The wallet’s documentation states that enforced simulations add an onchain verification step and a higher network fee.
The distinction matters for how much confidence to place in a preview:
- Offchain simulation tells you what the contract would do under observation.
- Enforced simulation makes behaving differently costly, because divergence reverts the transaction.
Only the second closes the red-pill gap. The first is still useful — it catches mistakes, revert conditions and unexpected balance changes — but it is a different claim.
Where the numbers can be wrong
Fee-on-transfer and rebasing tokens. A balance diff assumes the amount transferred equals the amount received. Some tokens take a fee on transfer, and some rebase balances. The preview may show the nominal amount while the actual credit differs.
Tokens the simulator does not know. MetaMask states that simulations are available for contract interactions and cover ERC-20, ERC-721 and ERC-1155 transfers. A token that does not follow those standards may not appear in the preview at all.
Gas estimation under state change. eth_estimateGas returns an estimate based on current state, and the Geth documentation notes that if no gas limit is specified it uses an upper bound from the pending block. If execution encounters a colder storage slot or a different code path than the estimate assumed, the forwarded gas can be insufficient and the transaction reverts.
Smart accounts and multisigs. If the account executes through a module or a multisig, simulating from the signer’s address may not reproduce the execution context of the account itself.
Cross-chain actions. A bridge deposit can simulate cleanly on the source chain while the credit on the destination chain depends on a relayer, a challenge period or a liquidity pool. The preview covers the part it can see.
Price display. A fiat value shown next to a token is a price feed’s estimate, not a settlement value. It can be stale or absent for a thin market.
A worked example: the cost of a passing simulation
Suppose a swap simulates successfully with a 0.50% slippage tolerance and returns an estimated 1,000 USDC for 0.30 ETH. The transaction is submitted with a gas limit of 180,000 and a gas price of 12 gwei.
- Maximum gas cost = 180,000 × 12 gwei = 2,160,000 gwei = 0.00216 ETH
- The simulation shows the swap succeeding and the 1,000 USDC arriving
Before inclusion, another trade moves the pool and the output falls below the minimum. The transaction reverts on the slippage check.
- USDC received: 0
- ETH spent on gas: up to 0.00216
- The simulation’s balance prediction: wrong, for a reason the simulation could not have known at the time
The lesson is not that simulation failed. It is that the prediction was conditional on state, and the condition changed. The only part of the preview that survives is the part under your control: the call you signed and the limits you set inside it.
A practical reading order
- Read the decoded call, not only the balance diff. An approval, a
setApprovalForAll, a permit, or a change of ownership is a durable grant. These deserve more scrutiny than a transfer of the same nominal size. - Check the limits inside the transaction. A minimum-output amount and a deadline are enforced onchain even if the simulation is stale. A transaction with no limit relies entirely on the preview being right.
- Treat the preview as a lower bound on what can go wrong. It reliably catches obvious reverts and misdirected transfers. It does not reliably catch authority, state dependence or simulation detection.
- Prefer enforced simulation where it is offered, and accept the extra gas as the price of the stronger claim.
- Review existing approvals separately. A clean simulation of today’s transaction says nothing about a permission granted last month. The allowance review and revoke guide covers that process, and what a hardware wallet does and does not protect against covers why the signing device cannot fix a bad payload.
How these sources were checked
The description of standard offchain simulation, the red-pill attack, enforced onchain simulation, the revert-on-mismatch behaviour, the supported token standards, the centralized simulation server and the higher fee for added protection all come from the MetaMask Help Center article “What are transaction simulations?”, retrieved 2026-10-24. The descriptions of eth_call and eth_simulateV1, the state override mechanism, the gas-cap parameter and the eth_estimateGas upper-bound note come from the Geth JSON-RPC documentation, retrieved 2026-10-24.
The worked examples are hypothetical arithmetic on stated amounts and fees. The 25,000 USDC balance, the 100 USDC deposit, the 180,000 gas limit and the 12 gwei gas price are illustrative, not observations of any wallet or transaction. Wallet behaviour differs by provider and version; confirm what your own wallet simulates before relying on it.
Sources
How this was researched. Wallet guides describe how key management works in general. Where an article describes a specific product's behaviour, its sources are listed below.
Primary sources for the factual claims on this page. A date appears only where a human has actually read the source; where it is missing, the check is still outstanding.
- MetaMask Help Center — What are transaction simulations?(read 2026-10-24)
- Geth documentation — JSON-RPC namespace, eth_call and eth_simulateV1(read 2026-10-24)
Frequently asked questions
Is a wallet transaction simulation a guarantee of what will happen?
No. Standard simulations run offchain against a copy of chain state. The real transaction executes later against a different block, and a contract can behave differently when it detects simulation. A preview reduces uncertainty; it does not remove it.
What is a red-pill attack?
It is a scam in which a malicious contract detects that it is being simulated, behaves harmlessly so the preview looks safe, then behaves maliciously when the real transaction executes. MetaMask documents this pattern as the reason offchain-only simulation is insufficient on its own.
Why does the simulation show no balance change for an approval?
Because an allowance is not a balance. Approving a spender does not move tokens at that moment; it grants the right to move them later. A balance-diff view can therefore show a near-zero change while the transaction has granted control over a much larger amount.
Can a transaction pass simulation and still fail onchain?
Yes. If the state changes between the simulated block and the block that includes the transaction — another trade moves the pool, an oracle updates, a slot is written — a check that passed in simulation can fail in execution. The transaction then reverts and you still pay gas.
What does enforced simulation do differently?
MetaMask describes enforced simulations as running the transaction onchain with the simulation result checked: if actual execution does not match the simulated outcome, the transaction reverts. That closes the gap between preview and execution, at the cost of a higher network fee.
Does a simulation protect against a malicious contract I have already approved?
No. Simulation looks at the transaction in front of you. A previously granted allowance can be exercised later in a separate transaction that you never see or simulate. Reviewing and revoking stale approvals is a separate task.
Where to go next
Independent research. Each card shows the platform’s invite code, and its Create Account button is a referral link that may earn us a commission at no extra cost to you. Whether an account can be opened is decided by the platform at sign-up.
Binance

One of the largest global exchanges by traded volume, with a very broad product range.
20% Trading Fee Rebate
Use invite code con888 when signing up to enjoy trading fee benefits.
Download from the exchange's official download service. Verify the source and follow the on-screen installation instructions.
Do not install an APK from an unknown source, or one that has been modified or cannot be checked.
OKX

A large global exchange offering spot, derivatives and a self-custody wallet.
20% Trading Fee Rebate
Enter invite code con888 when signing up to check available trading fee benefits.
Download from the exchange's official download service. Verify the source and follow the on-screen installation instructions.
Do not install an APK from an unknown source, or one that has been modified or cannot be checked.