Simulation and Testing Before Execution: How Safe Wallet’s Preview Prevents $10M Mistakes
A decentralized autonomous organization manages $15 million in stablecoins and governance tokens across multiple Layer 2 networks. Three signers from different time zones hold the keys to execute transfers, and each transaction requires two of the three approvals. The risk model is straightforward: if any single signer is compromised, the attacker still cannot move funds without a second key. But a different failure mode has already occurred at competing protocols: a treasurer, in a hurry, drafts a transaction sending funds to an incorrect smart contract address. All signers approve it. Within seconds, the funds are locked in an address with no recovery mechanism. The damage is permanent, and no cryptographic signature can undo it.
This scenario highlights a problem that multisignature design alone cannot solve. Requiring multiple approvals protects against a single compromised key, but it does not prevent a coordinator from drafting a flawed instruction that all signers mechanically approve. Safe Wallet, formerly Gnosis Safe, addresses this vulnerability through simulation and preview tools that execute transactions in a read-only environment before any real approval is recorded. These tools reveal the actual outcome—which addresses will receive funds, which contracts will be called, how much gas will be consumed—without committing to the irreversible settlement. Understanding what simulation does, what it cannot do, and how to use it correctly is essential for organizations managing shared treasuries and high-value assets.
Why simulation matters in a multisig context
A password-based wallet typically has one decision point: the moment the user signs and broadcasts the transaction. If the address, amount, or contract method are wrong, the mistake becomes visible only after the blockchain accepts the transaction. At that point, the user can attempt a recovery transaction if the destination address is controlled by another recoverable wallet. If it is a burn address, a non-existent contract, or a service that does not respond to rescue requests, the funds are lost.
A multisig wallet adds a verification layer by requiring independent review from multiple signers. In theory, each signer checks the details before signing. In practice, this is vulnerable to several failure modes. Signers may be under time pressure and glance only at the amount without verifying the recipient. The initiator may draft the transaction incorrectly and all signers may implicitly trust that it has been validated elsewhere. Communication about the transaction details may be incomplete, with some signers seeing different information or misinterpreting technical parameters. These are not cryptographic failures; they are coordination failures that occur because humans are approving instructions they cannot fully verify by visual inspection alone.
Simulation offers a third layer of protection that operates at the transaction level before execution. When a user drafts a transaction in Safe and clicks the preview function, the multisig wallet does not just display the input data. It creates a temporary, read-only copy of the blockchain state and actually executes the transaction within that copy. The simulation reveals the exact result: which tokens move, which accounts receive them, what state changes occur within called contracts, and whether the execution succeeds or fails. If the recipient address is wrong, the simulation shows funds arriving at the wrong destination. If the contract call will revert for any reason, the simulation reveals the error message before any signer has approved anything.
How Safe Wallet’s simulation infrastructure works
The simulation process relies on infrastructure that Safe Wallet providers maintain or integrate with. When a user connects to Safe through a supported interface, the software does not perform simulation on the user’s local device. Instead, it sends the transaction details to a service that has access to a copy of the blockchain state. This service can be a specialized simulation node, an archive node, or a third-party service such as Tenderly, Etherscan’s simulator, or other transaction analysis providers. The requesting wallet specifies the network, the transaction bytecode, the sender address, and the current block state. The simulation service then replays the transaction without writing anything to the actual chain.
The technical execution is called a “dry run.” Instead of executing the transaction and changing balances in the authoritative blockchain, the simulation modifies an in-memory copy of the state. Every SSTORE (storage write), CALL (contract invocation), and token transfer that would occur during real execution happens in the simulation. Any revert, out-of-gas error, or failed precondition also occurs and is logged. The result is a detailed transcript of what the transaction would do.
For Safe Wallet features that involve token swaps, bridge calls, or complex contract interactions, this simulation is indispensable. A user approving a transaction that calls Uniswap, Curve, or a bridge contract can see the exact output: how many tokens will be received, whether the trade will fail due to slippage, or whether the contract will revert due to a configuration change. For organizations managing treasuries through a smart contract wallet, the simulation also reveals gas consumption. If a proposed transaction will exceed available gas or require unexpected spending, the signers learn this before committing.
The limitation is that simulation depends on the accuracy of the blockchain state at the time of simulation. If the simulation is performed against an old block height, the result may differ from execution in the next block. Market conditions, contract state, and token balances can change. Additionally, the simulation service itself is a source of trust. If it is misconfigured, does not have the latest state, or is adversarial, the simulation results could be inaccurate. The tool reduces operational errors and catches common mistakes, but it does not replace careful review by signers who understand what the transaction is supposed to do.
Common mistakes that simulation catches
The most visible error that simulation prevents is sending funds to the wrong address. A treasurer intends to send 1,000 USDC to a vendor, but accidentally pastes an address from a different transaction. Without simulation, this mistake is discovered only after the tokens arrive at the wrong destination. The transaction is approved, broadcast, and settled. If the address is not controlled by a recoverable entity, the funds are gone. With simulation, the preview shows the tokens arriving at the unintended recipient, making the error obvious before any signer has approved.
Another common failure is calling a smart contract with incorrect parameters. A multisig treasurer wants to mint new governance tokens as part of a scheduled allocation. The contract function requires a target address and an amount. The coordinator provides the correct amount but the wrong minting address—perhaps copying an address from a similar previous transaction. The contract call will execute without reverting, and the tokens will be minted to the wrong account. Simulation reveals exactly which account will receive the newly minted tokens, allowing signers to catch the mistake before approval.
Slippage and market-dependent failures also appear in simulation results. If a transaction approval involves swapping 100 ETH for stablecoins, the simulation can indicate whether the swap will succeed at the current market price or will revert because the minimum output threshold is not met. This is especially valuable for large trades where market movement during the time between drafting and execution could cause failure. A signer reviewing the simulation can choose to adjust the acceptable slippage or wait for more favorable market conditions.
Gas miscalculation is another preventable error. A transaction that calls multiple smart contracts or transfers many tokens can consume more gas than expected. If the multisig wallet is funded with insufficient ETH for gas, the transaction will revert. Simulation reveals the actual gas cost, allowing the coordinator to add more ETH to the Safe or simplify the transaction. For layer-2 networks where gas prices vary, simulation provides an accurate estimate at the simulated block height.
What simulation cannot catch
Simulation is not a substitute for understanding the transaction’s purpose. If a signer has approved a transaction to bridge funds to a specific Layer 2 network, but that signer does not realize the bridge contract has a known vulnerability or delayed withdrawal, the simulation will show a successful execution on-chain. The simulation reveals what the blockchain will do, not whether the decision is strategically sound. A treasury transferring assets to what was believed to be a secure yield farm, but is actually a honeypot or vulnerable contract, will appear to succeed in simulation even if it is a catastrophic decision.
Simulation also depends on static blockchain state. It shows what will happen if the transaction executes in the next block with the current configuration of relevant smart contracts. If a signer approves a transaction but other transactions or state changes occur before the multisig transaction settles, the result can differ. For example, if the transaction is a call to a smart contract that requires a certain condition to be true, and another transaction modifies that condition between the simulation and the actual execution, the simulation result becomes stale. This is especially relevant for Layer 2 optimistic rollups, where transactions are submitted in batches and significant time can pass between submission and final settlement.
Authentication and permissioning also fall outside simulation’s scope. Simulation assumes the signer is authentic and authorized to approve the transaction. It does not detect if a signer’s hardware wallet has been compromised or if a multisig interface has been replaced by a malicious phishing site. A user who believes they are approving a transfer to a vendor’s address but who has actually been redirected to a fake interface may see a simulation that looks correct for a different transaction. This is why hardware wallet integration remains essential: the final approval should occur on a device the signer physically controls, not merely a screen that displays simulation results.
Integration with Safe Wallet’s approval workflow
When a transaction is drafted in Safe, the workflow typically proceeds as follows. The coordinator or first signer enters the transaction details: recipient address, token, amount, and any contract function calls. Before requesting approvals, they can access the preview or simulation. The multisig wallet interface displays the simulated result, showing which accounts will be affected, what tokens will move, and any error states. If the simulation reveals a problem, the coordinator can cancel, revise, and re-simulate without any transaction being recorded on the chain.
Once the simulation looks correct, the transaction is marked as pending and signers are notified. Each signer can review the transaction details and, if the Safe interface provides simulation, they can re-run the simulation to verify the preview independently. This is important because simulation results can change if conditions have shifted. A signer reviewing a transaction hours or days after initial drafting may see different market prices, contract state, or gas estimates. If a signer notices that the re-simulated result differs materially from the original preview, they should question whether conditions have changed or if the transaction should be cancelled and redrafted.
Signature collection and execution follow after all required signers have approved. Access to Safe Wallet login pages or supported interfaces allows each signer to review and sign according to the multisig threshold. Once signatures are collected, any authorized executor can submit the transaction to the blockchain. If the submission occurs quickly and market conditions have not shifted, the simulated result should match the actual execution closely.
Practical best practices for using simulation effectively
The first best practice is to re-simulate before final execution, not just before the first approval. If multiple signers are distributed across time zones or if approval collection takes several hours, conditions may have changed. A coordinator should re-run the simulation immediately before submitting the transaction to the blockchain. If the simulation result has changed significantly—different gas cost, different output amounts, or a new error—the transaction should be cancelled, re-drafted, and re-approved rather than executed with stale information.
The second practice is to not rely on simulation alone for verification. Simulation shows what the blockchain will do with the current state and configuration. It does not show whether the transaction is a good decision or whether it aligns with the organization’s intent. A second signer should independently verify the transaction details outside the interface, perhaps by reviewing the recipient address from an offline source or by cross-referencing the vendor information from prior communications. If possible, the signer should manually verify the receiving address on a hardware wallet or cold storage reference, not from a screen display.
The third practice is to establish clarity about who can draft and who must approve. In many DAOs and treasuries, a coordinator or multisig member prepares transactions, but approval is distributed to others who may have less operational familiarity. If a signer does not understand why a transaction is needed or does not have context for the decisions, they should ask for clarification before signing, simulation results notwithstanding. Simulation is a tool for catching errors, not for removing the responsibility to understand what is being approved.
Fourth, maintain an audit trail of simulations and approvals. Safe Wallet records transaction activity on-chain, but simulation logs may exist only on the service that performed the simulation. If possible, take screenshots or records of simulation previews and the block state at the time they were executed. This allows later audit or investigation if the actual result differs from what was simulated. It also provides evidence that signers reviewed the transaction details before committing.
Simulation as one layer of a defense-in-depth approach
Simulation addresses a specific vulnerability: the gap between what a multisig coordinator drafts and what signers actually approve. It is not a complete security solution. A comprehensive treasury management practice combines multiple controls. Hardware wallets as signers reduce the risk that a compromised computer can forge approvals. Geographic distribution of signers reduces the risk that a single adversary or event can compromise all keys. Threshold configuration—requiring 2-of-3 or 3-of-5 signatures, for example—reduces the impact of a single key loss. Role-based access control, such as restricting who can draft transactions or who can execute final submissions, reduces the number of people who can introduce errors.
Simulation sits alongside these controls as a way to catch honest mistakes that survive the organizational review process. It is not a guarantee that all errors will be caught. A signer who approves without actually reviewing the simulation, or who reviews but does not understand the transaction’s technical implications, can still cause harm. The tool amplifies the effectiveness of careful signers; it does not replace caution.
For organizations managing shared treasuries, yield farming operations, or protocol governance, simulation is a practical necessity. The cost of a $10 million transfer to the wrong address is so high that any tool that prevents the mistake is worth using. The time investment to review a simulation preview is minutes; the potential loss of funds is permanent. Simulation does not make multisig treasury management bulletproof, but it eliminates one of the most common and devastating failure modes: the well-intentioned transaction sent to the wrong destination.
Frequently asked questions
What happens if the blockchain state changes between simulation and actual execution?
Simulation shows what will occur at the block height and state at the time of simulation. If other transactions execute before the multisig transaction settles, the actual result may differ. For example, if a contract state variable is modified, or if a price oracle updates, the simulated output may differ from the real output. This is why signers should re-simulate shortly before execution and should verify that critical parameters (amounts, recipient addresses, thresholds) match the original intent.
Can simulation detect if a smart contract is malicious or vulnerable?
No. Simulation shows the logical result of executing the smart contract code as written. If the contract code is designed to steal funds, transfer them to an attacker, or exploit a known vulnerability, the simulation will show that behavior occurring—but only if a signer understands what the expected behavior should be. Simulation detects functional errors and incorrect parameters, not malicious intent in the contract logic itself.
Do I need simulation for every transaction, or only for high-value transfers?
Simulation is most valuable for transactions involving unfamiliar recipients, complex contract interactions, or high amounts. A routine transfer to a well-known vendor address has lower risk. However, because simulation is fast and available in most Safe interfaces, running it for all transactions creates a consistent verification practice and catches mistakes that might otherwise go unnoticed. The cost of using simulation is minimal; the potential benefit is protecting against irreversible losses.