sauce command to prepare a USDC payment on Base. You will write a program, compile it, simulate both success and failure, and build an unsigned transaction. None of that needs a wallet or a key. Creating a wallet and sending the transaction are the optional final steps.
If you want the concepts first, read the introduction to Sauce. For other tasks, browse the Sauce SDK quickstarts.
The program runs on a Pot, an account that holds its funds. A cook is the transaction that runs the program. A Pot belongs to an owner, an address that is the only account that can send its cooks. Simulating and building a cook only need the owner’s address. You pass it with --owner.
Compilation, simulation and transaction building do not sign or send transactions. To follow the same workflow through a coding agent, see AI agents.
Prerequisites
- Node.js 24 or newer, a terminal, and the
saucecommand from Installation. - The release’s engine deployed on Base. Simulating, building and sending a cook need it, and
sauce pot --chain base --owner <address>reports whether it is deployed. - For the optional send step: a wallet, 1 USDC on Base, and enough ETH on Base for gas and the Kitchen fee.
- To send without real funds, run each step with
--chain base-sepoliainstead of--chain base. Base Sepolia is a supported testnet: itsUSDCis Circle’s testnet USDC and gas is testnet ETH. The program and commands are otherwise the same. See Testnets.
1
Write the program
pot is your Pot, available without declaring it, and pot.USDC is its USDC balance (Names).Save this as pay.sauce.ts:pay.sauce.ts
main’s parameters are the program’s inputs. You pass them with--args, in order.amountis in raw token units: USDC has 6 decimals, so1000000is 1 USDC.USDCneeds no import and no address: it resolves to USDC’s address on the chain you compile for.requirereverts the whole cook when its condition is false.USDC.transferpays from the Pot, with the checks of OpenZeppelin’sSafeERC20.
2
Compile it
--chain solana.3
Simulate it
- It reads Base’s current state, through a built-in public endpoint unless you pass
--rpc-urlor--config. - It runs the cook as if the owner sent it, and derives the owner’s Pot from that address.
--assume-balance USDC:5gives the Pot 5 USDC for this simulation only. It changes nothing on chain, and it is not a deposit: the real Pot still holds what it holds. Unlike--args, it takes whole tokens, soUSDC:5is 5 USDC, the same as5000000in raw units.
- [1] The owner sends the fee to the Pot as the cook’s value.
- [2] The Pot pays the Kitchen’s execution fee.
- [3] The Pot pays 1 USDC to the recipient.
sauce run would. Gas, fees and the block number depend on chain state when you run it, so your numbers will differ.Now give the Pot less than the amount:require reverted the cook, so nothing would move. Add --expect-revert "not enough USDC" to make a revert like this the passing outcome (exit 0), for example in a script.4
Build an unsigned transaction
sauce tx prints unsigned transactions as JSON. It takes the same --owner as the simulation, so the plan uses the same Pot:- the Kitchen’s
deployPot, which any account may send; - the cook, which only the owner may send.
value of the cook is the Kitchen’s execution fee in wei, read from the chain. sendCalls holds both transactions as one batch, for a wallet that sends batches.Notes on stderr explain the prerequisites for sending. Because the Pot holds no USDC, a note says the cook would revert with not enough USDC. That is expected here: the plan is for a Pot you fund. Add --fund USDC:1 to put a transfer of 1 USDC from the owner into the Pot, after its deployment and before the cook. That transfer reverts unless the owner holds the USDC.You can stop here if you only want to build a transaction. To send it later, build it with --owner set to an address you control: only that account can send the cook.5
Optional: create a wallet to send
Only sending needs a key. The owner you used above was a stand-in, so a Pot you fund and cook on must be the one your own wallet owns. Create a wallet:The command asks for a password twice (at least 8 characters). It then writes an encrypted keystore to Your wallet will have its own address. Already have a key? Use The Pot address in the report is now your wallet’s Pot.
~/.sauce/wallets/me.json and prints the address:sauce wallet import me <file> instead (sauce wallet). This is a hot wallet: keep small balances in it. A policy file can cap what it sends (Wallets, passwords and spending policy).Later commands select it with --wallet me, which names the owner in place of --owner. Simulate again from your wallet’s address to see the plan for your Pot, with no password and nothing sent:sauce tx signs nothing and takes no --wallet: pass --owner $(sauce wallet address me) to rebuild the unsigned plan for it.6
Optional: send with sauce run
This step spends real funds. Fund your wallet’s address (The report states the Kitchen’s execution fee in wei and ETH. Read it from this command when you send, not from these docs. It changes, and on a testnet it can be 0 (Send 1 USDC on Base to the
sauce wallet address me) with enough ETH on Base for gas and the Kitchen fee. Then read the current fee, and whether the engine and Kitchen are deployed and your Pot is:sauce pot --chain base-sepolia --wallet me).Deploy your Pot, which sends the deployment and waits for the Pot’s code:"pot" address it prints. Deploy before you send funds: until the Pot is deployed, its address is a prediction that a Kitchen upgrade can move (Funding a Pot). Then:sauce run then does the following:- Asks for the wallet’s password.
- Checks the Pot. A Pot with no code yet is deployed first, after you approve it, in a transaction of its own.
- Simulates the cook, signs it, sends it and waits for the receipt.
- Prints the hash, the status and the gas used. If the cook reverts, it prints the decoded reason and exits with status 1.
--assume-balance is for sauce simulate only. sauce run uses the Pot’s real balance, so it reverts with not enough USDC until the Pot holds the USDC. For scripts or CI, configure a password source and explicit approvals as described in sauce run. The command stops when it needs an interactive answer that it cannot obtain.What you built
- The program compiled to bytecode for V12, the Sauce engine. The engine runs that bytecode; you do not deploy a separate contract for the program.
- The cook is a transaction to the owner’s Pot. If you send it successfully, the Pot runs the program, pays the recipient and pays the Kitchen its fee.
- If the
requirefails, the whole cook reverts and only the gas is spent. The program catches no failure, so any failed call would revert it the same way. - Tokens left in the Pot stay there until a later cook moves them.
Troubleshooting
- The engine is not deployed: compilation still works, but simulation and execution require the matching release on Base. See deployment troubleshooting.
- The program reports
not enough USDC: an assumed balance applies only to simulation. Deploy and fund the Pot before sending, or use funding in the cook, which deploys the Pot first. - RPC calls fail: configure an endpoint with
--rpc-urlor--config. See endpoint troubleshooting.
Next steps
- AI agents: have your coding agent write and simulate programs.
- sauce simulate and sauce run: every option.
- Funding a Pot: pull tokens into the Pot in the same cook with
--fund. - Compiling programs from TypeScript: the same steps from your application.
- Sauce SDK quickstarts: adapt a complete payment, swap or lending example.
