What a wallet should show before signing, and how much a bot can take from a swap.

Preview and sandwich check

Transaction preview

npx shadowfork preview --from 0x…beef --to 0x08cd2e72e156d8563b4351eb4065c262a9f553ef \
  --value 100000000000000000000 --data 0x7ff36ab5… --balance 1000000000000000000000

Over JSON-RPC: shadowfork_preview(tx, "latest", { stateOverrides }). The preview page shows it as a wallet would.

Part From
You send, you receive Native value and token movements of the signer's own account
Allowances you grant Approval and ApprovalForAll events where the signer is the owner, with unlimited ones flagged
Contracts that run Every address with code in the call tree, named from the QIE explorer, unverified ones flagged
Fee Gas billed under QIE's fee floor, in QIE and in USD from the QIE Oracle (with the price's age)
Why it fails The revert explanation, when the transaction would revert

Warnings, most serious first:

Warning When
This transaction will fail The simulation reverts
Allowance to a plain account An allowance to an address with no code
Unlimited allowance Any allowance of 2^255 or more
Unverified contracts run A contract in the call tree has no verified source
A price feed is stale A price read during execution is older than 3 hours and the reading contract accepted it
Gas limit higher than needed The limit is more than twice the gas used, so QIE bills for unused gas

Why it fails

shadowfork_explain(tx, block) and every failed simulation or replay walk the call tree to the frame where the failure started. They decode the revert data in this order:

  1. Error(string)
  2. Panic(uint256), with the meaning of the code
  3. A custom error from the contract's verified ABI on the QIE explorer
  4. The public signature database

The reason is then matched against common patterns to suggest a fix: slippage, deadline, allowance, balance, access control, pause, out of gas, and QIE's invalid opcodes. Failures that a caller caught are listed separately.

Sandwich exposure

npx shadowfork sandwich --from 0x…beef --to <router> --value 100000000000000000000 --data 0x7ff36ab5…

For a Uniswap-V2-style swap that starts from QIE, each attack size runs on a fresh fork:

  1. An attacker buys the same path first.
  2. Your swap runs and must still clear its own amountOutMin.
  3. The attacker sells back.

The largest attack your swap survives is your exposure; the output you lose and the attacker's net are measured, not estimated. On a 100 QIE to QUSDC swap with amountOutMin 0, a front-run of 6,400 QIE took 33.8 percent of the output; with 5 percent slippage allowed, the most a sandwich could take was 2.8 percent. The reply suggests an amountOutMin 0.5 percent under the quote.