> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrading

> Move the sauce command, a project and its programs to a new release of @eco-incorp/sauce.

> [!NOTE]
>
> Archived documentation for `@eco-incorp/sauce@0.99.16`. Install this release with `npm install --save-exact @eco-incorp/sauce@0.99.16`. Links to guides outside this tab open current documentation.

A package release can update the CLI, agent skills, compiler and its paired engines. Update your installation and agent configuration together, then recompile and simulate programs before using the new release with funds. The migration notes below cover changes to existing programs and application code.

## Prerequisites

* The `sauce` command or the package installed. See [Installation](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/installation.md).
* Node.js 24 or newer.

## Check for an update

```bash theme={null}
sauce --version
sauce update --check
```

`sauce update --check` reads the npm registry. It prints the installed version, how the command was installed, and the version an update would install. It installs nothing:

```text theme={null}
@eco-incorp/sauce <version>, <project>'s own copy (npm); the latest is <latest>
```

### The update notice

After a command, one line on stderr says when a newer release is published:

```text theme={null}
sauce <version> → <latest> is available: run `sauce update`
```

The line comes from a cache, `~/.sauce/update-check.json`, which is refreshed from the npm registry at most once a day, in a background process that no command waits for. The first command after a release may not show the line yet. It goes to stderr only, so `--json` output and stdout pipes are unaffected.

To turn the notice off:

* pass `--no-update-check`, which every command takes, before or after the command name;
* or add `"updateCheck": false` to the `--config` file a command is given.

`--offline` also turns it off. `sauce mcp` prints no notice: it adds a note to its first tool result instead.

## Update

> [tab] Global install
>
> ```bash theme={null}
> sauce update
> ```
>
> npm, pnpm, yarn or bun installs the new version globally, as the command was installed, and prints the version before and after. The new `sauce` then updates the agent skills installed in the current directory and prints what changed. Where the replaced version had its runtime packages installed, the new version installs its own.

> [tab] A project's dependency
>
> In a project that depends on `@eco-incorp/sauce`, `sauce update` runs nothing. It prints the command for the project's package manager, pinned exactly:
>
> ```bash theme={null}
> npm install --save-exact @eco-incorp/sauce@latest
> ```
>
> Run that command, then commit the updated `package.json` and lockfile. A project made with `sauce init` pins the package to one exact version, so every machine and CI job runs the same command and compiler.

> [tab] npx
>
> ```bash theme={null}
> npx -y @eco-incorp/sauce@latest <command>
> ```
>
> `@latest` makes npx fetch the latest release instead of reusing the copy in its cache.

`sauce update --version <version|tag>` installs a given version or dist-tag instead of `latest`. From any other kind of installation, `sauce update` refuses and prints npm's global install command.

## Check after updating

### Agent skills

The skills in a project are copies from one version of the package.

```bash theme={null}
sauce skills status
```

```text theme={null}
claude (.claude/skills): up to date (<version>)
```

`status` exits 1 while any target is outdated or not installed. Run it in CI to catch a package upgrade the skills have not followed. To bring the skills to the installed version:

```bash theme={null}
sauce skills update
```

`update` adds new skill files, replaces changed ones and removes retired ones. A file you edited since it was installed is kept and its diff is shown, unless you pass `--force`. See [sauce skills](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/cli/skills.md).

### Runtime packages

`sauce mcp`, and a Solana simulation in a local copy, load packages each version installs for itself in `~/.sauce/runtime/<version>`.

```bash theme={null}
sauce runtime
```

```text theme={null}
Runtime packages, in ~/.sauce/runtime/<version> (installed):
  sauce mcp          @modelcontextprotocol/sdk <version> and zod <version>: the runtime folder
  Solana simulations litesvm <version>: the runtime folder
```

A new version installs its folder on first use, or at once with `sauce runtime install`. Older versions' folders are then removed, except the newest of them. See [sauce runtime](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/cli/runtime.md).

### The MCP entry

`sauce mcp setup` writes `npx -y @eco-incorp/sauce@<version> mcp` into each agent's project file. Rewrite it for the new version, then restart the agent's session:

```bash theme={null}
npx -y @eco-incorp/sauce@latest mcp setup --force
```

An entry that runs a global `sauce mcp` uses the global version after `sauce update`.

### Compiled programs and unsigned transactions

A program is compiled by the compiler the package pins and run by the engine paired with that compiler. Compiler output and engines pair by exact version: an engine runs only the output of its paired compiler. See [V12](https://docs.eco.com/sauce-versions/0.99.16/sauce/v12.md).

* **Recompile after you upgrade.** Do not store bytecode and send it later through a newer version. The `sauce` command compiles the file you give it on every run.
* **Rebuild unsigned transactions.** A cook printed by `sauce tx` before the upgrade names the previous engine. Build it again.
* **Check that the engine is deployed** on the chain you send on: `sauce pot --chain <chain> --owner <address>` reports it.
* **Simulate again** before you send with funds. See the [production checklist](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/operating/production-checklist.md).
* **Know which release made each Pot.** `sauce pot list` shows each recorded Pot with the release it was created under.
* **In TypeScript**, every SDK builder that names an engine checks the pairing and throws for an engine paired with a different compiler. [Troubleshooting](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/operating/troubleshooting.md) shows the message.

### Settlement pins

A compiler upgrade can change a program's bytes without changing its source, so a settle program's hash changes with it. Import the SDK's pins (`SETTLE_WIRE` from `@eco-incorp/sauce/verify`) rather than copying their values. The default check accepts the current pin only. To keep accepting an earlier version, pass its pin explicitly as a `{ hash, bytes }` record, or `sauce verify --pin <hash:bytes>` on the command line. See [Verification](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/typescript/verification.md).

## Breaking changes from the previous release

This release moves the compiler and every engine and Kitchen together. Update them together: recompile every program and rebuild every transaction. Each change below says what to do.

### Arguments are ABI-encoded only

Program inputs are always ABI-encoded (`entryEncoding` is `"abi-v1"`). Compact arguments are removed.

| Remove | Use instead |
| - | - |
| `--compact-args` on `compile`, `actions`, `simulate`, `run`, `tx` and `inspect` | Nothing: drop the flag |
| The MCP `compactArgs` input of `sauce_compile` and `sauce_actions` | Nothing: drop the input |
| `compactArgs: true` in a raw `compile()` call | Drop the option. `compactArgs: true` throws, and `false` is accepted |
| `entrySchema`, `encodeCompactArguments`, `decodeCompactArguments` and `scalarWidth` options | `routes.encodeEntryArguments` for SDK programs |

A raw `compile()` result now carries `entryParams`. A top-level fixed-size tuple parameter is marked `indirect: true`; encode it as the ABI encodes a dynamic value. See [Compiling](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/typescript/compiling.md).

### Signed values: `Int256`

Negative literals, ABI `intN` outputs and `Math.signExtend` results are `Int256`, and the arithmetic and comparison operators are signed on `Int256` values.

| Change | What to do |
| - | - |
| `Math.sDiv`, `sMod`, `sShr`, `sLt`, `sGt`, `sLte` and `sGte` are removed | Use `/`, `%`, `>>`, `<`, `>`, `<=` and `>=` on `Int256` values |
| Mixing `Int256` and `Uint256` in one expression does not compile | Convert one operand with `Int256(value)` or `Uint256(value)` |
| `Int256(value)` and `Uint256(value)` are checked conversions: `Uint256(-1)`, or assigning a negative `Int256` to a `Uint256`, reverts | Keep values in range, and `require` before a conversion that can fail. `Int256.fromBits(word)` reinterprets the bits of a `Uint256` instead |
| A negative literal cannot initialize a `Uint256` | Declare it `Int256`: `const delta: Int256 = -10` |
| Negating a nonzero `Uint256` (`-amount`) reverts | Write `-Int256(amount)` |
| A helper that returns a signed value needs a `: Int256` return type | Annotate it |
| `Uint256` and `Int256` are reserved names | Rename locals, parameters, constants, imports and functions that used either name |
| An `int256` ABI argument takes a signed value | Pass `-1`. The constant `~0` is `-1` there too, a constant two's-complement word such as `2 ** 256 - 10` is refused ("constant expression is outside Int256's range"), and a run-time `Uint256` holding those bits reverts the call |
| Arrays and tuple fields keep their ABI integer kind | Use `Int256[]` for `intN[]` and `Uint256[]` for `uintN[]`. Converting a scalar does not convert a container |
| Narrow ABI integers (`uint8`, `int128` and the rest), in arguments and in results, are range-checked | Out-of-range or dirty words now revert. Pass values that fit the declared type |

### Unread call results are not checked

On EVM chains, a bound contract call whose result the program never reads is not decoded or validated, even when it is assigned to an unused variable. A successful empty or malformed reply, or a call to an address with no code, then passes.

* Read the result where you rely on it: reading any part decodes and checks every declared output.
* Check `ctx.isContract(address)` where a target must have code.
* Move tokens with the SDK's checked writes (`USDC.transfer`, `@sauce/token`). A raw `IERC20.at(token).transfer(...)` with a discarded result does not check the reply.

An explicit `abi.decode` stays checked.

### `try`/`catch` on EVM chains

A `try` block of several statements is atomic: on failure, its calls, storage writes and variable assignments are rolled back before `catch` runs. Assignments roll back too, unlike JavaScript. Work before the block stays. A `try` around a single external call, and `.catch()` on a call, cover that call's failure only, not the decoding of a successful reply. The handler receives at most 256 bytes of revert data, which may be empty or truncated: check it before decoding it. Solana programs have no `try`/`catch`.

Review each recovery path and simulate it. A statement-form `.catch()` on a bound method with a narrow integer output, such as `uint128`, can be refused at compile time. For a method with one output, use the value form and read its result: `const value = call.catch(() => { return 0; });`.

### The Pot is `pot`, and the native coin `.balance`

Each has one spelling, with no alias. The old spellings no longer compile, and each error names the new one.

| Before | Now | What it reads |
| - | - | - |
| `self` | `pot` | The Pot's address; on Solana its account too (`pot.signer()`, `pot.writable()`) |
| `self.USDC` | `pot.USDC` | The Pot's balance of a token the chain registers |
| `self.ETH`, `who.ETH`, `who.SOL` | `pot.balance`, `who.balance` | The holder's native coin: wei on an EVM chain, lamports on Solana |
| `Solana.self` | `pot` | The Pot's account on Solana |

```ts upgrade.sauce.ts theme={null}
// Returns the Pot's USDC, and reverts if the Pot holds none of the chain's native coin.
//
//   sauce simulate upgrade.sauce.ts --chain base --owner <owner>
function main(): Uint256 {
  require(pot.balance > 0, "no native coin");
  return pot.USDC;
}
```

The same program written with `self.ETH` stops at its first old spelling:

```text theme={null}
`self.ETH`: the Pot is `pot`, not `self`: write `pot.balance` (`pot` is the Pot's address, `pot.<TOKEN>` its balance of a token, `pot.balance` its native coin).
```

* **Rename in programs only.** The `"self"` value of an actions document (`"recipient": "self"`) and of the TypeScript token, deposit and actions APIs is unchanged, so a project-wide replace of `self` breaks them. `ctx.self()`, `ctx.balance(x)` and `ctx.selfBalance()` are unchanged.
* **A program that declares or imports its own `pot` or `self` owns the name**, and so does a compile whose `defines` or `contracts` give one. A `pot` that only an `ambient` module exports is refused, naming its line and column: write `ctx.self()` for the Pot, or import the module's `pot` by name.
* **`.SYMBOL` always reads a token the chain registers.** On Arc, whose native coin is USDC, `pot.USDC` reads the 6-decimal token and `pot.balance` the 18-decimal coin, where `self.USDC` was refused as ambiguous.
* **`.balance` reads a field wherever it did**: on a record, a list, a value `abi.decode` returns, and a struct a contract call returns. For the native coin of such a value, write `ctx.balance(x)`.
* **On Solana, `pot.owner` is refused.** An account's `.owner` is the program that owns it, so it read the program owning the Pot's account. The refusal names `Solana.owner`, the owner who signs the cook.
* **On Solana, bare `pot` is the Pot's signer slot**, `Account<Signer>`, where `Solana.self` was. A program that names `pot` anywhere derives its accounts from the Pot (`pot`, `pot:USDC`), so a cook `--via engine`, which has no Pot, refuses it; for a direct cook write the signer's account (`Solana.owner`, or `ctx.self()` as a token holder) where you wrote `pot`. A program that never names `pot` derives them from `authority` (`authority:USDC`) and runs either way.
* **In `--account` values and Solana derivations, `self` is `authority`**: the account that signs the engine call, the Pot through the Kitchen and the owner with `--via engine`. `self:<TOKEN>` is `authority:<TOKEN>`, in a `pda:` seed too, where a bare `authority` seed is now that key's 32 bytes: write `"authority"` for the word. An account given for a slot derived from the Pot, the owner or the authority must be the account its derivation gives, or the command exits 2. See [Solana from the CLI](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/cli/solana.md#name-an-account-with---account).

### Test a name instead of calling `available(X)`

Every registry name is declared on every chain, and a name the chain lacks is zero there. `available(...)` is removed: a call to it is refused with "`available(X)` is removed: test the name itself, `if (X)`." Where you wrote `available(X)`, write `if (X) { … }`, `if (!X) return 0;`, `X != 0` or `X ? a : b`:

```ts upgrade-presence.sauce.ts theme={null}
// Returns the 0.05% Uniswap V3 pool of `tokenA` and `tokenB` where the chain has Uniswap V3, else 0.
function main(tokenA: Address, tokenB: Address): Address {
  if (UniswapV3.Factory) {
    return UniswapV3.Factory.getPool(tokenA, tokenB, 500);
  }
  return 0;
}
```

* **The branch a test rules out is still not compiled**, and the program's bytes do not change from the `available(X)` form.
* **A use of the name outside such a branch is refused at the use, naming the chain**, and so is `require(X != 0)` on a chain without `X`. A decision held in a variable (`const has = X != 0; if (has) { … }`) is not a test.
* **`&&` and `||` give `true` or `false`** on a contract too: `const a = UniswapV3.Factory; return a || 0;` returns `true`. A program's own `IERC20.at(x) || y` as a value used to return the operand's address; it returns the bool now.
* **The names are not a module.** A program reads them with no import; `import … from "@sauce/chain"` is refused.

See [Names](https://docs.eco.com/sauce-versions/0.99.16/sauce/names.md#using-a-name-only-where-the-chain-has-it).

### Pots on EVM chains

| Change | What to do |
| - | - |
| New Pots have new addresses: the same owner and salt give a different Pot | Derive Pot addresses with `sauce pot` or `v12PredictPot`, never from a stored value |
| The new engine does not run Pots created under the previous release. Their funds stay in them | Manage an old Pot with the previous SDK, compiler and engine. Review the destination before you move funds out. An upgrade never moves balances |
| Pots created under this release add `cookSigned` and `invalidateNonces`: a Pot runs a cook its owner signed, for whoever submits it | Old Pots do not gain them. The owner signs with [`sauce sign`](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/cli/sign), the MCP server's `sauce_sign`, or `signedCookTypedData` from `@eco-incorp/sauce/evm/engine`, and any account sends the result ([Signed cooks](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/typescript/cook-transactions.md#signed-cooks)) |
| The execution Router is content-addressed. `v12RouterGeneration()` is removed | Compare Routers with `v12RouterAddress()`. The quote Router, `v12QuoteRouterAddress()`, is unchanged |

### Solana

The engine program id and the Kitchen's cook format change: the Kitchen validates the Pot account with its salt and canonical bump, which the builders derive. Rebuild every cook and staged-cook instruction with this SDK, and never replay a serialized cook built earlier. High-level builder calls take the same arguments. A hand-built cook prepends `buildHeapFramePrepend()` once.

### The `sauce` command, the MCP server and the library

| Change | What to do |
| - | - |
| The chain exports (`Base`, `Solana` and the rest) are plain namespaces: calling one, or its `.route`, is removed | Use their properties. Compile programs with `routes.compileSauceProgram` or `@eco-incorp/sauce/compiler` |
| The default Pot salt is exported as `DEFAULT_POT_SALT` (the zero bytes32), with no alias | Import it by this name |
| `destinationExecutionFee` is renamed `kitchenExecutionFee`, with no alias | Rename the import |
| `sauce inspect` no longer takes `--args` or `--args-json` | Pass `--source <file>`: it decodes the arguments from the cook |
| `sauce verify`'s result no longer has `callIndex` or `target` | Read the remaining fields |
| `--store` is removed from `run`, `send` and `mcp` | Drop the flag |
| MCP `sauce_compile` no longer takes `rpcUrls`, and `sauce_inspect` no longer takes `args` | Drop those inputs |
| The compile option `accessors: { selfSugar }` is `accessors: { potSugar }`, for the bare `pot` rewrite | Rename the option. A bare `self` is refused either way |
| `CompiledSauceProgram.derivedAccounts` and a manifest slot's `derive` name the Pot's accounts `pot` and `pot:<TOKEN>` where the program names `pot`, and `authority` and `authority:<TOKEN>` where it does not, in place of `self` and `self:<TOKEN>` | Match the new names where your code reads them |
| A cook on a preview chain is refused by its own chain | Send on Ethereum, Base, Arc or Solana |
| The testing kit's `run` uses the pending block's gas limit as its budget, with no gas estimate or simulation first | Nothing for most tests. `gasUsed` is still the gas consumed |
| The settle program is recompiled: 410 bytes, with a new hash | Import `SETTLE_WIRE`. Accept the previous 435-byte pin only as an explicit `{ hash, bytes }` record |

## Next steps

* [Production checklist](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/operating/production-checklist.md): before running the upgraded version with funds.
* [Troubleshooting](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/operating/troubleshooting.md): when something stopped working after the update.
* [sauce update](https://docs.eco.com/sauce-versions/0.99.16/sauce-sdk/cli/update.md): every flag of the command.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.