> ## 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.

# verify: Test vectors

> Test vectors: the declaration and description of each of the 6 exports of @eco-incorp/sauce/verify.

`@eco-incorp/sauce/verify` checks an EVM settle payload: its program bytes against accepted program pins (by default, the settle program this package pins), and its argument tail `(tokens, minOut, recipient)` against the canonical encoding. It imports viem only, so it runs in a browser or an edge runtime without loading the compiler.

```typescript theme={null}
import { validateSettleProgram, encodeSettleProgram } from "@eco-incorp/sauce/verify";
```

Generated from the type declarations of `@eco-incorp/sauce`.

### `SETTLE_PROGRAM`

*Variable* · `@eco-incorp/sauce/verify`

The compiled `recipes/settle.sauce.ts` program - 410 bytes, measured by compiling it with the
published Rust compiler (`@eco-incorp/sauce-compiler`) against the package's own
`artifacts/IERC20.json`.

ONE constant covers the whole corpus because the program is INVARIANT: `main` takes
`(tokens, minOut, recipient)` as runtime entry arguments, so no caller value reaches the
compiler.

```typescript theme={null}
SETTLE_PROGRAM: Hex
```

### `SETTLE_VECTORS`

*Variable* · `@eco-incorp/sauce/verify`

Golden wire-format vectors - the Go/Solidity/Python conformance corpus, and the definition of the
layout for anyone reimplementing the decoder.

The bytes below are what the engine reads,
not what this package's encoder happens to emit.

`v3` carries `Z = 0x0000000000000000000000000000000000ff00aa`, an address with leading zero
bytes. The wire is fixed-width, so it is an ordinary 32-byte word: leading zero bytes cost
nothing and mean nothing. `SETTLE_REJECTIONS` holds the payloads a decoder must refuse.

```typescript theme={null}
SETTLE_VECTORS: readonly ConformanceVector[]
```

### `SETTLE_REJECTIONS`

*Variable* · `@eco-incorp/sauce/verify`

Payloads a conformant decoder MUST refuse.

The `engineAccepts` rows are the trap proper, and they are the reason this corpus exists at all: the
engine RUNS them and produces exactly the behavior of the canonical payload beside them, so they
are distinct byte strings with identical meaning. A decoder that accepts any of them is not
injective, and `encodeSettleProgram` re-encode-and-compare stops agreeing with decode-and-compare.
`upperBytes` is the sharpest: the engine masks a call target to 160 bits, so twelve arbitrary
bytes ride along in a token word and sweep the very same token.

Each vector's `code` is reachable under ANY check order, so a Go or Solidity reimplementation is not
required to match this decoder's sequence to pass. `tokensPointer` is the one that has to be built
for that: its padding word is `0x02` so that the count read at the canonical offset agrees with the
tail length, leaving the non-canonical pointer as the only complaint. A length-first decoder and a
pointer-first decoder both report `TOKENS_OFFSET`. (The engine reads its array from offset 128, so
that word is not in its read path -- `engineAccepts` is unaffected by its value.)

```typescript theme={null}
SETTLE_REJECTIONS: readonly RejectionVector[]
```

### `settlePayload`

*Function* · `@eco-incorp/sauce/verify`

The full on-the-wire payload for a vector's tail: `program || args`.

Exported from `./verify`, so it takes a caller's hex rather than only this file's literals: an
unprefixed tail would otherwise lose its first byte to the slice and resurface as a puzzling
`ARGS_TRUNCATED`, and a `0X` prefix - which the decoder itself tolerates - would produce garbage.
Requires the canonical `0x`, consistent with `encodeSettleProgram`'s inputs.

```typescript theme={null}
export declare function settlePayload(args: Hex): Hex;
```

### `ConformanceVector`

*Interface* · `@eco-incorp/sauce/verify`

```typescript theme={null}
export interface ConformanceVector {
    name: string;
    tokens: Hex[];
    minOut: bigint;
    recipient: Hex;
    args: Hex;
}
```

### `RejectionVector`

*Interface* · `@eco-incorp/sauce/verify`

```typescript theme={null}
export interface RejectionVector {
    name: string;
    args: Hex;
    code: SettleFailureCode;
    engineAccepts: boolean;
    sweepsIdentically: boolean;
}
```


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