Skip to main content
sauce inspect reads calldata, a transaction or a program file and reports what it does: the engine and program of a cook, the Pot a deployment makes, or the parameters a program takes.

Synopsis

Description

The operand is one of:
  • Calldata in hex, or - to read it from stdin:
    • a Pot.cook: the engine it names, whether that is the released engine, and the program’s size and keccak256 hash;
    • a Kitchen.deployPot: the Pot it deploys, with its owner and salt;
    • an ERC-20 call;
    • bare program bytes.
  • A 32-byte transaction hash, with --chain or --rpc-url: the transaction is fetched first. The report gives its status, sender, value and call; what it cost (gas, an OP-stack chain’s L1 data fee, the value); and the token transfers, approvals and net balance changes its receipt’s logs record.
  • A program file: it is compiled for the chain, and the report gives the program’s size and hash, and the parameters main takes.
With --source <file>, a cook’s program is compared with the program that file compiles to, and the arguments appended after it are decoded against that file’s main. There is no opcode listing or disassembly: programs are reported by size and hash. The command signs and sends nothing, and works on every chain in the registry.

Options

Low-level options

--help lists these apart, with the note “a program’s inputs are main’s parameters, given with —args”.

Output

Text on stdout; endpoint notes on stderr. With --json, a cook reports call (Pot.cook), engine (address, and released: whether it is the released engine) and program (size, keccak256, and with --source, source: the file, whether the program matches, argumentsSize and the decoded arguments with name, type and value). Exit codes: 0 on success; 1 when what it was given cannot be read, such as a missing file (sauce inspect: does-not-exist.json: no such file) or a transaction hash with no such transaction on the chain; 2 for a usage error.

Examples

The examples take apart the transactions sauce tx built for this program on Base:
pay.sauce.ts
The Pot had no code, so tx.json holds two transactions: the Kitchen.deployPot, then the cook.

Decode a cook against its source

The cook carries 218 bytes: the 154-byte program and two 32-byte arguments.

The same, as JSON

Decode a Pot deployment

Inspect a program file

Next steps

  • sauce verify: check that a cook runs the settle program the package ships.
  • sauce tx: build the cook this command decodes.
  • Cook: what a cook’s calldata holds.