Simulate a Token Mint, Approve, and TransferFrom Bundle
Simulate a 3-step bundle that mints DAI, approves a spender, and transfers tokens, with shared state across steps for testing multi-transaction flows.
This guide builds a 3-step simulation bundle that exercises the classic ERC-20 approval flow: mint tokens to a holder, approve a spender, then let the spender call transferFrom. Each step depends on state that the previous step creates, which is why a bundle is the right tool here.
Simulating each transaction in isolation breaks down:
Mint alone: you can verify the mint logic, but the holder address has no tokens on mainnet.
Approve alone: the simulation needs the holder to actually have a balance to approve from.
TransferFrom alone: requires both the balance and the approval to be in place.
A Sim Bundle runs all three in sequence, sharing the resulting state. Step 2 sees the minted balance from step 1. Step 3 sees the approval from step 2.
DAI’s mint function is guarded by a wards mapping: only addresses registered as wards can call it. The fake ward (0xe2e2...e2) is not a ward on mainnet. To make this step succeed, add a state override that sets the ward storage slot for that address to 1:
The holder approves a spender to pull up to 1 DAI. This step works because step 1 already credited 2 DAI to the holder’s balance in the shared state stream.
The spender moves 0.03 DAI from the holder to a recipient. This works because step 2 granted the allowance, which is only visible inside the bundle’s state stream, not on-chain.
Then expand State overrides, add the DAI contract, and enter the ward storage slot and value from the table above. Click Add storage override to commit the slot.
Step 1 with the mint calldata filled and the ward state override configured.
4
Add Step 2: Approve
Click + Add function call in the bundle rail. Switch the new step to Raw mode. Set:
Click Simulate (or press ⌘↵). All three steps execute in sequence. Click each step in the rail to inspect its decoded output, gas used, events, and token transfers.
The bundle after running: step 2 (approve) is focused, showing the Approval event and decoded output.
Step 3 (transferFrom) succeeded. The 0.03 DAI transfer is visible in the ERC-20 transfers tab.
The response is an array of three simulation results, one per step. Each entry contains status, gasUsed, decoded logs, a trace, assetChanges, and balanceChanges.A successful run shows "status": true for all three steps. If a step reverts (for example, because the state override is missing from step 1), the API returns all results up to and including the failing step, and subsequent steps are not run.
assetChanges entry with "type": "Mint" and 2 DAI credited to the holder. Transfer event from the zero address.
Approve
Approval event in logs. No asset changes (approvals don’t move tokens).
TransferFrom
assetChanges entry with "type": "Transfer" and 0.03 DAI moving from holder to recipient. Transfer event in logs. balanceChanges showing negative delta for the holder and positive for the recipient.