sauce simulate compiles a program, builds its cook and simulates it from the Pot’s owner against a chain’s current state. It broadcasts no transaction.
Synopsis
Description
sauce simulate compiles the file (a .sauce.ts program or an actions document), builds the cook on the Pot of --owner (with --salt), or on the Pot --pot names, and simulates it as sent from the owner. It broadcasts nothing and starts no local node. Without a key it signs nothing; given the owner’s key and --fund, it signs the token pulls and does not send them. On an EVM chain any address works as the owner.
It prints the gas, what main returns and what the cook moved, or the decoded reason it reverts.
On an EVM chain it simulates through eth_simulateV1, which returns the cook’s logs. The report lists the ERC-20 transfers and approvals (registry symbols, whole units), the native transfers the node traces, and each address’s net balance change. An endpoint without eth_simulateV1 falls back to eth_call with state overrides: that route gives the result and the gas, but no logs. The report names the route it took.
- A Pot not deployed yet is deployed in the simulation first, from
--owner(and--salt). Any account may send the Pot’s deployment, and the Pot is the owner’s either way. - The cook’s value defaults to the Kitchen’s execution fee, read from the chain. An owner holding less than the value is given it for the simulation.
--assume-balance TOKEN:amountgives the Pot that balance for this simulation only, by state override. The command finds the token’s balance storage by asking the token, witheth_call. A token that stores no balance it reports (rebasing tokens, shares) is refused. Funding a Pot covers the amount syntax.--fundwith the owner’s key (--keystore,--private-keyor--wallet) includes the pullssauce run --fundwould make, signed and not sent; an approval the run would ask for is reported and simulated before the cook, not sent. With no key the pulls cannot be signed, so the Pot is credited what they would bring, by state override, and--sweepstill runs.--blockpins every read and the simulation to one block, so a price read at that block can be simulated on the same state.
--owner, with signatures unchecked, and prints the compute units, the execution fee it read, and each token account’s and lamport balance change, or the reason and the program logs. Each account main takes is given with --account; the accounts the token methods and venue namespaces add are derived. Solana’s simulateTransaction takes no account overrides, so the owner must hold the Pot’s rent and the fees. A cook too large for one transaction, or one given --assume-balance, is simulated in a local copy of the accounts it names, with LiteSVM, which the package installs on first use (sauce runtime). Solana covers the account forms and --via engine.
Simulation needs the release’s engine deployed on the chain. It is not limited to the supported chains: it runs on a preview chain where the release is deployed, such as Optimism. Where the engine has no code, the command exits 1 with the released engine <engine address> is not deployed on <chain>: this SDK's cook cannot run there.
Prerequisites
On an EVM chain, the release’s engine must be deployed on the chain.sauce pot --chain <chain> --owner <address> reports whether it is.
Options
EVM chains only
Solana only
Low-level options
--help lists these apart, with the note “a program’s inputs are main’s parameters, given with —args”.
Output
The text report on an EVM chain, top down:- The headline: the cook succeeds, with its gas and what
mainreturned (decoded wheremaindeclares a return type). - What is left in the Pot, with what it held before.
- The route and block it simulated on, and each transaction simulated: the Pot’s deployment first when needed, then the cook.
- What the simulation assumed, by state override.
- What moved, in order, each party by role:
wallet,Pot,Kitchen, a registry name or a token symbol. - Each address’s net balance change.
1, and the first line is The cook reverts: <reason>. A require message decodes as the program threw "…". With --json, reverted: true and error lead the object, and the same line leads stderr.
With --json a successful simulation prints one object. Its main fields:
Exit codes:
0 when the cook succeeds (with --expect-revert, when it reverts with the expected reason), 1 when it reverts (with --expect-revert, when it succeeds or reverts otherwise), 2 for a usage error.
Examples
The examples simulatepay.sauce.ts on Base. The owner 0x1111…1111 is an arbitrary address; its Pot has no code on Base, so each simulation deploys it first. The Kitchen’s address is shown as <kitchen address>; it is on the deployments page.
Simulate with a balance the Pot does not hold
Check that a guard fires
With 0.5 USDC in the Pot, the program’srequire stops a 1 USDC payment:
0. Without --expect-revert, the same simulation exits 1.
Print the report as JSON
assumed, transactions, moves, nativeTransfers, balanceChanges and otherLogs are left out.
Simulate a funded run with no key
--sweep returned the 0.5 USDC the program left in the Pot.
Next steps
sauce run: sign and send the cook after simulating it.sauce tx: the unsigned cook, for another signer.- Funding a Pot:
--fund,--fund-mode,--sweepand--assume-balance. - Solana: accounts,
--viaand the local copy. - Chains and endpoints: endpoints and preview chains.
