By Abigail Hueber
A user connects to a decentralized exchange, approves what appears to be a routine token swap, and submits the transaction. Within seconds, their wallet is empty. The contract they approved was not a legitimate DEX but a malicious smart contract designed to drain whatever funds the user had authorized. This scenario has cost millions in aggregate, yet it remains preventable through a single technical intervention: showing users exactly what a transaction will do before they sign it.
Transaction simulation is not a new concept in blockchain development, but its integration into self-custodial wallet interfaces remains uncommon. Most wallets show only the contract address and a generic “confirm transaction” prompt, leaving users to guess whether they are approving a legitimate protocol interaction or handing over control of their assets to a scammer. Rabby Wallet changes that calculation by parsing smart contract calls, predicting their outcomes, and displaying human-readable previews of what will happen if the user signs. The result is a concrete reduction in approval exploits, rug pulls disguised as token launches, and the class of scams that rely on users not understanding what they are authorizing.
The Ethereum approval mechanism, governed by the ERC-20 standard, permits a user to grant a contract the ability to transfer tokens on their behalf. This design is essential for DeFi—a user must authorize a decentralized exchange, lending platform, or liquidity pool to move their funds as part of a legitimate transaction. However, the same mechanism becomes a vector for theft when users blindly approve contracts without understanding what they authorize.
A typical wallet displays something like “Contract 0x1234… requests permission to spend unlimited DAI.” The user sees no indication of what the contract will actually do. Will it swap the DAI for USDC and return the proceeds? Will it transfer every token to an attacker’s address? Will it call a secondary contract that drains the wallet across multiple transactions? Without simulation, there is no way to know. Attackers exploit this opacity by creating contracts that perform unexpected operations—often a combination of deceptive UI, social engineering (phishing links to a fake DEX interface), and contracts designed to steal rather than trade.
The problem compounds because approval transactions are not reversible. Once signed, a contract holds the authority to transfer approved tokens until the user revokes it. A scammer can execute multiple theft transactions hours, days, or weeks later, long after the user has forgotten what they authorized. Some exploits even include logic that waits for a high-value token transfer to enter the wallet, then immediately drains it. The user’s first sign that something went wrong is often a notification that their wallet is empty.
Existing wallet warnings sometimes flag known malicious contracts, but they rely on retroactive detection. New malicious contracts bypass these lists entirely. Address reputation databases help, but a freshly deployed contract designed to scam users will not yet appear in any database. The fundamental vulnerability is not incomplete data about bad actors. It is the absence of accurate, real-time information about what a transaction will do.
Transaction simulation inverts the order of understanding. Instead of signing first and learning consequences later, the wallet executes the transaction against a fork of the blockchain state—a temporary, isolated copy of the network at the current block height. This fork is not written to the actual network; it exists only in memory for the purpose of calculating outcomes. The wallet then analyzes what the simulated execution would produce: which tokens move, how much, to which addresses, at what cost in gas.
For a user approving a swap on a DEX, simulation might reveal: “You will send 10 USDC to contract 0x5678… and receive approximately 0.45 ETH.” If the user instead encounters: “You will send 10 USDC and receive 0 ETH,” or “Your entire wallet balance will be transferred to 0xabcd…,” the difference is immediately visible. A malicious contract that attempts to drain the wallet in the same transaction as the user’s intended swap cannot hide its behavior because simulation shows all state changes that would result.
Rabby’s implementation parses the decoded transaction data, identifies the contract functions being called, and uses RPC methods (JSON-RPC calls to a blockchain node) to simulate execution. The wallet then formats the predicted outcome in human language rather than raw bytecode. This translation is critical because even technical users rarely read hexadecimal contract calls. A preview stating “Transfer 100 USDT to address 0xdef0…” is meaningful; raw calldata is noise.
The simulation also accounts for nested contract calls. A user might approve a router contract that then calls a DEX, which calls a lending protocol, which adjusts token balances across multiple accounts. Each layer is traced, and the net effect is summarized. If a scam contract hides its malicious operation deep in a call stack, simulation will surface it because the wallet evaluates the complete execution, not just the first-order function call.
One of the most dangerous approval patterns is the unlimited allowance. A user grants a contract the authority to transfer not just today’s transaction amount, but the entire balance of that token in perpetuity. This approach simplifies UX—the user approves once and can use the service repeatedly without re-approving. But it also maximizes the damage if the contract is compromised or if a user accidentally approves a malicious contract.
Transaction simulation makes this risk visible. When a user approves an unlimited allowance, Rabby’s preview explicitly warns that the contract will have unlimited spending authority going forward. If the user instead sees that a contract will drain the wallet immediately as part of the approval transaction, simulation has caught a scam in real time. For legitimate services, simulation shows exactly what the transaction will do, letting the user make an informed choice about whether the approval amount matches the intended operation.
Many modern DeFi protocols now support transaction-specific approvals, where a user grants permission to transfer only the exact amount needed for a single transaction. Simulation makes this safer pattern more attractive because users can see that only 10 USDC will be approved rather than 1,000 USDC or unlimited amounts. Some services allow users to set expiration dates on approvals, after which the contract no longer has authority. Rabby displays these parameters, helping users distinguish between reckless and cautious approval designs.
The self-custodial nature of Rabby means the wallet never holds the user’s private keys on a server, so a compromised wallet service cannot steal approved funds. But a compromised user device, a phishing attack that tricks a user into signing a malicious transaction, or a user’s own mistake in approving the wrong contract can still cause loss. Transaction simulation cannot prevent users from approving scams they explicitly choose to sign, but it can make that choice informed rather than blind.
Different DeFi operations have different signatures and risks. A token swap typically involves specifying input and output amounts, with slippage tolerance to account for price movement. Simulation shows the user the expected output based on current liquidity and prices. If slippage is too high or liquidity is too low, the simulated output will be substantially different from the user’s expectation, and the preview will reflect that.
Lending protocol interactions are more complex. A user depositing collateral and borrowing funds is actually performing multiple operations: transferring tokens to the contract, registering the deposit, and then requesting a loan. Simulation reveals the exact loan amount the user will receive, the collateral deposited, the interest rate, and the liquidation price at which the position becomes unsafe. If a user’s input parameters are wrong—for example, they accidentally set the collateral amount to 1 million dollars instead of 1,000—simulation shows the catastrophic result before the transaction is signed.
Staking pools, yield farming, and complex DeFi strategies often involve approving multiple contracts in sequence. Each approval is simulated independently, but users benefit from seeing the complete transaction chain. A protocol that requires approving contract A to approve contract B is riskier than one requiring a single approval, because if contract A is compromised, contract B becomes accessible to the attacker. Simulation helps users understand this dependency and make decisions about whether the expected yield justifies the approval risk.
For MEV (maximal extractable value) concerns, simulation also shows the exact amount the user will pay in gas fees and any additional value extracted by arbitrageurs or searchers. Users often approve transactions with dangerously high slippage limits, not realizing that MEV bots will capture most of the difference. Simulation makes that tradeoff explicit, encouraging users to set tighter slippage and gas price parameters.
Many users accidentally submit transactions to the wrong blockchain. A user intends to swap on Optimism but signs a transaction on Ethereum, paying expensive gas fees for an operation that should have been cheap. Worse, some scams exploit this confusion by creating lookalike DEXes on multiple chains and phishing users to the expensive network while stealing their tokens on a cheaper one.
Rabby’s automatic network-switching feature detects when a dApp requires a different blockchain and prompts the user to switch before approving the transaction. The wallet displays which network the transaction will be executed on, reducing the chance of accidental cross-chain operations. Transaction simulation then applies to the correct network, using live price data and liquidity from the user’s intended chain.
For users managing positions across multiple EVM-compatible networks—Base, Arbitrum, Optimism, Polygon, BNB Smart Chain, and others—this clarity is essential. A transaction preview that shows “Swap 10 ETH on Optimism to 5000 USDC” is accurate only if the network is actually Optimism. If the wallet silently switched to Ethereum without clear notification, the same transaction might have completely different slippage and gas costs. Rabby’s approach of making network context explicit in the transaction preview prevents this class of error.
The network awareness also helps users avoid contracts that are deployed on multiple chains but have different behaviors. A legitimate protocol on Ethereum might have been forked by attackers on a lesser-known chain where transaction monitoring is weaker. Simulation on the correct network ensures that the user is evaluating the contract state and behavior that actually applies to their transaction.
Rabby supports hardware wallet connections, allowing users to secure private keys on a physical device while still using the wallet’s simulation and preview features. This combination maximizes security: the wallet interface cannot steal private keys because they are never transmitted to the software, yet the user still benefits from transaction simulation before signing on the hardware device.
Hardware wallets traditionally display only contract addresses and transaction hashes, with no meaningful preview. A user approving a contract on a Ledger or Trezor might see only “0x1234…” with no indication of what the contract will do. Rabby’s browser extension simulates the transaction locally and can display a human-readable preview before the user even touches the hardware wallet. This design respects the security boundary—simulation happens in the extension, not on the hardware device—while still providing the context needed for informed decisions.
However, simulation has limits. If a hardware wallet displays a different address or amount than the extension preview, the user should assume the hardware wallet is correct. Hardware wallet screens are less likely to be compromised than software interfaces, so they serve as a final verification step. Simulation is best understood as a pre-signing guard, not a substitute for careful attention during the actual signing process.
Simulation also cannot protect against phishing that occurs before the wallet is opened. If a user is tricked into visiting a fake DEX website and manually enters their recovery phrase, simulation cannot help. The security benefit applies after that user has opened Rabby and is being prompted to approve transactions. For users who learn more about the wallet’s features, understanding this boundary between what simulation prevents (transaction-specific scams) and what it does not (credential theft, browser compromises) is essential for realistic security planning.
Transaction simulation depends on querying a blockchain node to fetch current state data—token balances, contract code, liquidity pools, interest rates, and other information that determines what a transaction will produce. If the node returns false information, simulation can produce incorrect previews. This is not a vulnerability in Rabby itself but a dependency on the integrity of the node.
Users can configure which node Rabby uses. A user running a personal Ethereum node has strong assurance that the data is accurate. A user relying on a public RPC endpoint has less control but still benefits from simulation that is more accurate than no preview. Even an imperfect simulation beats the alternative of approving transactions blind.
For decentralized finance, multiple redundant nodes and backup RPC providers reduce the risk that a single malicious or misconfigured node will lead to a bad transaction. Rabby’s design allows configuration of custom RPC endpoints, and the free public endpoints are exposed to the entire Ethereum ecosystem, making it in the node operators’ interest to provide accurate data.
Simulation also does not account for state changes that occur between the time the preview is generated and the transaction is signed and broadcast. If another transaction on the network modifies a contract’s state (for example, consuming all liquidity in a DEX pool), the simulated outcome may be incorrect. For large transactions or times of high network congestion, this risk is real. Users should treat simulation as a strong defense against obvious scams and misconfigurations, not as a guarantee that their transaction will succeed exactly as previewed.
The core insight behind transaction simulation is that users make better decisions when they understand what they are authorizing. Obscurity—hiding transaction consequences behind generic prompts—benefits scammers and legitimate services that fear users making informed choices. Transparency benefits everyone except attackers.
Rabby’s commitment to open-source development (the browser extension is available on GitHub) means that security researchers, competing wallet developers, and users themselves can audit how simulation is implemented. This visibility is not a perfect guarantee against bugs, but it is substantially more trustworthy than closed-source wallet software where the code cannot be independently reviewed.
As DeFi becomes more complex, the importance of readable transaction previews will only grow. A future transaction might involve flashloans, cross-chain swaps, governance voting, NFT operations, and token transfers all in a single atomic execution. A wallet that can parse and summarize these nested operations in human language provides a critical safety layer. Users who understand what they are signing are less likely to lose funds to scams, less likely to make mistakes, and more likely to use DeFi protocols in ways that match their actual intent.
The practical effect is that an attacker’s cost of scamming increases. A malicious contract that relies on users not reading what they approve must now overcome Rabby’s simulation, which surfaces the attack immediately. The scammer’s options narrow to phishing (tricking users into visiting fake websites), social engineering (convincing users that a malicious transaction is legitimate), or stealing recovery phrases through other means. These attacks are still possible, but they are harder and require compromising channels outside the wallet itself.
Simulation prevents scams that rely on users not understanding what they are approving. It shows malicious contract behavior, unexpected token transfers, and incorrect parameters before signing. However, it cannot prevent phishing (fake websites or recovery phrase theft), social engineering (convincing users that a malicious transaction is legitimate), or compromised devices. Security requires both simulation and user awareness.
If transaction simulation reveals that the transaction will drain your wallet, transfer to the wrong address, or produce zero output when you expected real output, do not sign it. This is typically a sign that you have either approved a malicious contract or made a configuration error. Cancel the transaction, verify the contract address against official documentation, and try again with corrected parameters.
Simulation is only as accurate as the blockchain node data it receives. If your RPC endpoint is misconfigured or malicious, simulation may produce incorrect previews. Using a reliable RPC provider (official or widely trusted public endpoints) improves accuracy. For high-value transactions, running your own node or using multiple redundant endpoints increases confidence that simulation reflects the actual network state.