Skip to main content
sauce tx compiles a program and prints the unsigned transaction that runs it on a Pot, for a wallet or signer of your choice to sign.

Synopsis

Description

sauce tx compiles the file (a .sauce.ts program or an actions document) and prints the cook unsigned, as JSON: { chainId, to, data, value }, where to is the Pot and data is Pot.cook(engine, program ++ arguments). It never takes a key and signs nothing. The value is --value, else the Kitchen’s execution fee read from the chain. Reading the fee also reads the Pot.
  • A Pot with no code yet. The command prints a plan instead, { chainId, pot, transactions }: Kitchen.deployPot first (marked deploysPot; any account may send it), then the cook. Send them in that order.
  • Gas. Each transaction of a plan carries a gas limit the command simulated: the cook’s is estimated as if the transactions before it had landed, with 30% room. When the cook would revert on the chain as it is (an unfunded Pot), the transactions carry no gas, and stderr says why.
  • Batches. Each transaction is in the shape a wallet’s send call takes (value and gas in hex), and sendCalls holds all of them as one batch, for a wallet that sends a batch.
  • --fund TOKEN:amount plans a plain transfer of each token from the owner into the Pot before the cook. With an endpoint, an EVM Pot that has no code yet is deployed first, so the transfer comes after the deployment. With --offline the command cannot check whether the Pot is deployed, and the plan has no deployment step: deploy the Pot first. ETH:<amount> adds to the cook’s value instead. Sent as one batch, a smart wallet deploys, funds and cooks with one approval, or nothing happens. Funding a Pot covers the amount syntax.
  • --format cast prints each transaction as a cast send line with placeholders.
What must hold for the transaction to land goes to stderr: on an EVM chain, the Pot funded after its deployment, and the cook sent from its owner (cook() is onlyOwner). On Arc and Arc Testnet, stderr also says that a transaction is included only with a maxFeePerGas of at least 20 gwei, the chain’s minimum base fee; the printed transactions carry no fee fields. On Solana it prints { chain, via, feePayer, pot, fee, maxExecutionFee, createsPot, transaction }: the Kitchen’s cook as a base64 transaction signed by no one, for --owner to sign, or with --via engine the engine’s own paid cook, with no Pot. A Pot not created yet is created by the same transaction, ahead of the cook (createsPot). The command reads the cluster for the blockhash and the fee. Solana covers the account forms and the plan a cook too large for one transaction becomes. sauce tx prints a transaction only on a supported chain: Ethereum, Base, Arc and Solana, and the testnets Arc Testnet, Base Sepolia, Ethereum Sepolia, Solana Devnet and Solana Testnet. On a preview chain it is refused before anything is read, with a message that names the supported chains and how to request the refused one.

Prerequisites

On an EVM chain, the release’s engine must be deployed on the chain for the cook to run. 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

stdout carries the JSON (there is no --json flag: JSON is the default format), or the cast send lines with --format cast. stderr carries the Pot and its owner, the conditions for the transactions to land, and notes on gas and balances. Exit codes: 0 when the transaction or plan is printed, 1 on a preview chain or a compile failure, 2 for a usage error.

Examples

The examples build the cook of pay.sauce.ts on Base for the arbitrary owner 0x1111…1111, whose Pot has no code on Base. Calldata is cut short, and the Kitchen’s address is shown as <kitchen address> (see deployments).

Build the plan for a Pot with no code

stderr explains why the cook carries no gas:
On an EVM chain, fund the Pot once its deployment has landed, not before: until then its address is the Kitchen’s prediction (Funding a Pot). With an endpoint, --fund, below, plans the transfer after the deployment and before the cook. With --offline the command cannot check whether the Pot is deployed, so the plan has no deployment step: deploy the Pot first. The note quoted above says the Pot’s address takes tokens before it is deployed; follow this paragraph instead.

Fund the Pot in the same batch

With the transfer planned first, the cook simulates and gets a gas limit, 0x1bf56 (114518): 88091 used, with 30% room.

Build offline

With no endpoint the command cannot see whether the Pot exists, so it prints the cook alone and says on stderr that the Pot must be deployed and funded. A cook with a value below the Kitchen’s fee reverts on chain.

Refuse a preview chain

The command exits 1.

Next steps