@eco-incorp/sauce 0.99.1 → 0.99.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/LICENSE.md +29 -0
  2. package/README.md +69 -249
  3. package/actions/dist/to-sauce.d.ts.map +1 -1
  4. package/actions/dist/to-sauce.js +4 -5
  5. package/dev-tools/README.md +11 -170
  6. package/docs/README.md +39 -0
  7. package/docs/api/README.md +71 -0
  8. package/docs/api/compiler.md +234 -0
  9. package/docs/api/coverage.md +117 -0
  10. package/docs/api/routes.md +110 -0
  11. package/docs/concepts/architecture.md +134 -0
  12. package/docs/concepts/saucescript.md +172 -0
  13. package/docs/examples/README.md +34 -0
  14. package/docs/examples/compile-program.ts +20 -0
  15. package/docs/examples/evm-execution.ts +59 -0
  16. package/docs/examples/first-intent.ts +56 -0
  17. package/docs/examples/protocol-approval.ts +33 -0
  18. package/docs/guides/builders-and-actions.md +108 -0
  19. package/docs/guides/compiling.md +264 -0
  20. package/docs/guides/intents.md +158 -0
  21. package/docs/guides/nested-intents.md +79 -0
  22. package/docs/guides/protocols-and-tokens.md +116 -0
  23. package/docs/guides/quick-start.md +64 -0
  24. package/docs/guides/solana.md +196 -0
  25. package/docs/guides/verification.md +253 -0
  26. package/package.json +9 -4
  27. package/sdk/dist/artifacts/V12Deployments.json +23 -5
  28. package/sdk/dist/artifacts/V12RuntimeBytecode.json +1 -1
  29. package/sdk/dist/artifacts/svm/engine-devnet.so +0 -0
  30. package/sdk/dist/artifacts/svm/engine-mainnet.so +0 -0
  31. package/sdk/dist/artifacts/svm/engine-wire-devnet.json +3 -3
  32. package/sdk/dist/artifacts/svm/engine-wire-mainnet.json +3 -3
  33. package/sdk/dist/deployments/index.d.ts +14 -46
  34. package/sdk/dist/deployments/index.d.ts.map +1 -1
  35. package/sdk/dist/deployments/index.js +22 -47
  36. package/sdk/dist/deployments/index.js.map +1 -1
  37. package/sdk/dist/deployments/v12-addresses.d.ts +9 -5
  38. package/sdk/dist/deployments/v12-addresses.d.ts.map +1 -1
  39. package/sdk/dist/deployments/v12-addresses.js +5 -6
  40. package/sdk/dist/deployments/v12-addresses.js.map +1 -1
  41. package/sdk/dist/deployments/v12.generated.d.ts +3 -3
  42. package/sdk/dist/deployments/v12.generated.d.ts.map +1 -1
  43. package/sdk/dist/deployments/v12.generated.js +3 -3
  44. package/sdk/dist/deployments/v12.generated.js.map +1 -1
  45. package/sdk/dist/deposit/index.d.ts +28 -102
  46. package/sdk/dist/deposit/index.d.ts.map +1 -1
  47. package/sdk/dist/deposit/index.js.map +1 -1
  48. package/sdk/dist/deposit/params.d.ts +1 -1
  49. package/sdk/dist/deposit/params.js +2 -2
  50. package/sdk/dist/deposit/params.js.map +1 -1
  51. package/sdk/dist/deposit/source.d.ts +1 -1
  52. package/sdk/dist/deposit/source.d.ts.map +1 -1
  53. package/sdk/dist/deposit/source.js +18 -33
  54. package/sdk/dist/deposit/source.js.map +1 -1
  55. package/sdk/dist/deposit/types.d.ts +5 -4
  56. package/sdk/dist/deposit/types.d.ts.map +1 -1
  57. package/sdk/dist/evm/engine.d.ts +32 -0
  58. package/sdk/dist/evm/engine.d.ts.map +1 -1
  59. package/sdk/dist/evm/engine.js +2 -0
  60. package/sdk/dist/evm/engine.js.map +1 -1
  61. package/sdk/dist/index.d.ts +1 -0
  62. package/sdk/dist/index.d.ts.map +1 -1
  63. package/sdk/dist/index.js +2 -0
  64. package/sdk/dist/index.js.map +1 -1
  65. package/sdk/dist/plugin/index.d.ts +16 -41
  66. package/sdk/dist/plugin/index.d.ts.map +1 -1
  67. package/sdk/dist/plugin/index.js +2 -6
  68. package/sdk/dist/plugin/index.js.map +1 -1
  69. package/sdk/dist/recipes/index.js +2 -2
  70. package/sdk/dist/recipes/settle.sauce.ts +1 -1
  71. package/sdk/dist/routes/index.d.ts +3 -3
  72. package/sdk/dist/routes/index.js +3 -3
  73. package/sdk/dist/routes/intent-dsl.d.ts +23 -10
  74. package/sdk/dist/routes/intent-dsl.d.ts.map +1 -1
  75. package/sdk/dist/routes/intent-dsl.js +19 -2
  76. package/sdk/dist/routes/intent-dsl.js.map +1 -1
  77. package/sdk/dist/routes/nest.d.ts +23 -0
  78. package/sdk/dist/routes/nest.d.ts.map +1 -1
  79. package/sdk/dist/routes/nest.js +2 -4
  80. package/sdk/dist/routes/nest.js.map +1 -1
  81. package/sdk/dist/routes/protocol-rewrite.d.ts +2 -2
  82. package/sdk/dist/routes/protocol-rewrite.d.ts.map +1 -1
  83. package/sdk/dist/routes/protocol-rewrite.js +19 -35
  84. package/sdk/dist/routes/protocol-rewrite.js.map +1 -1
  85. package/sdk/dist/routes/sauce-calls.d.ts +7 -13
  86. package/sdk/dist/routes/sauce-calls.d.ts.map +1 -1
  87. package/sdk/dist/routes/sauce-calls.js +6 -11
  88. package/sdk/dist/routes/sauce-calls.js.map +1 -1
  89. package/sdk/dist/routes/sauce-route.d.ts +24 -53
  90. package/sdk/dist/routes/sauce-route.d.ts.map +1 -1
  91. package/sdk/dist/routes/sauce-route.js +5 -6
  92. package/sdk/dist/routes/sauce-route.js.map +1 -1
  93. package/sdk/dist/routes/source-globals.generated.d.ts +931 -0
  94. package/sdk/dist/routes/source-globals.generated.d.ts.map +1 -0
  95. package/sdk/dist/routes/source-globals.generated.js +7 -0
  96. package/sdk/dist/routes/source-globals.generated.js.map +1 -0
  97. package/sdk/dist/std/token/token.svm.js +19 -14
  98. package/sdk/dist/svm/cpi-probe.d.ts +1 -1
  99. package/sdk/dist/svm/cpi-probe.d.ts.map +1 -1
  100. package/sdk/dist/svm/cpi-probe.js +5 -2
  101. package/sdk/dist/svm/cpi-probe.js.map +1 -1
  102. package/sdk/dist/svm/intent.d.ts +12 -40
  103. package/sdk/dist/svm/intent.d.ts.map +1 -1
  104. package/sdk/dist/svm/intent.js +22 -66
  105. package/sdk/dist/svm/intent.js.map +1 -1
  106. package/sdk/dist/svm/venues/byreal/index.d.ts.map +1 -1
  107. package/sdk/dist/svm/venues/byreal/index.js +4 -1
  108. package/sdk/dist/svm/venues/byreal/index.js.map +1 -1
  109. package/sdk/dist/svm/venues/carrot/index.d.ts.map +1 -1
  110. package/sdk/dist/svm/venues/carrot/index.js +4 -0
  111. package/sdk/dist/svm/venues/carrot/index.js.map +1 -1
  112. package/sdk/dist/svm/venues/cropper/index.d.ts +1 -1
  113. package/sdk/dist/svm/venues/cropper/index.js +1 -1
  114. package/sdk/dist/svm/venues/huma/index.d.ts.map +1 -1
  115. package/sdk/dist/svm/venues/huma/index.js +4 -1
  116. package/sdk/dist/svm/venues/huma/index.js.map +1 -1
  117. package/sdk/dist/svm/venues/index.d.ts +1 -0
  118. package/sdk/dist/svm/venues/index.d.ts.map +1 -1
  119. package/sdk/dist/svm/venues/index.js +1 -0
  120. package/sdk/dist/svm/venues/index.js.map +1 -1
  121. package/sdk/dist/svm/venues/math.d.ts +4 -1
  122. package/sdk/dist/svm/venues/math.d.ts.map +1 -1
  123. package/sdk/dist/svm/venues/math.js +4 -1
  124. package/sdk/dist/svm/venues/math.js.map +1 -1
  125. package/sdk/dist/svm/venues/meteora-damm-v1-stable/index.d.ts.map +1 -1
  126. package/sdk/dist/svm/venues/meteora-damm-v1-stable/index.js +4 -1
  127. package/sdk/dist/svm/venues/meteora-damm-v1-stable/index.js.map +1 -1
  128. package/sdk/dist/svm/venues/meteora-damm-v2/index.d.ts.map +1 -1
  129. package/sdk/dist/svm/venues/meteora-damm-v2/index.js +5 -2
  130. package/sdk/dist/svm/venues/meteora-damm-v2/index.js.map +1 -1
  131. package/sdk/dist/svm/venues/obric-v2/index.d.ts.map +1 -1
  132. package/sdk/dist/svm/venues/obric-v2/index.js +16 -5
  133. package/sdk/dist/svm/venues/obric-v2/index.js.map +1 -1
  134. package/sdk/dist/svm/venues/oracle-exponent.d.ts +82 -0
  135. package/sdk/dist/svm/venues/oracle-exponent.d.ts.map +1 -0
  136. package/sdk/dist/svm/venues/oracle-exponent.js +97 -0
  137. package/sdk/dist/svm/venues/oracle-exponent.js.map +1 -0
  138. package/sdk/dist/svm/venues/orca-legacy-token-swap/index.d.ts.map +1 -1
  139. package/sdk/dist/svm/venues/orca-legacy-token-swap/index.js +4 -1
  140. package/sdk/dist/svm/venues/orca-legacy-token-swap/index.js.map +1 -1
  141. package/sdk/dist/svm/venues/pumpswap/index.d.ts.map +1 -1
  142. package/sdk/dist/svm/venues/pumpswap/index.js +19 -13
  143. package/sdk/dist/svm/venues/pumpswap/index.js.map +1 -1
  144. package/sdk/dist/svm/venues/raydium-amm-v4/index.d.ts.map +1 -1
  145. package/sdk/dist/svm/venues/raydium-amm-v4/index.js +4 -1
  146. package/sdk/dist/svm/venues/raydium-amm-v4/index.js.map +1 -1
  147. package/sdk/dist/svm/venues/raydium-clmm/index.d.ts.map +1 -1
  148. package/sdk/dist/svm/venues/raydium-clmm/index.js +4 -1
  149. package/sdk/dist/svm/venues/raydium-clmm/index.js.map +1 -1
  150. package/sdk/dist/svm/venues/raydium-cp-swap/index.d.ts.map +1 -1
  151. package/sdk/dist/svm/venues/raydium-cp-swap/index.js +4 -1
  152. package/sdk/dist/svm/venues/raydium-cp-swap/index.js.map +1 -1
  153. package/sdk/dist/svm/venues/scorch/index.d.ts.map +1 -1
  154. package/sdk/dist/svm/venues/scorch/index.js +4 -1
  155. package/sdk/dist/svm/venues/scorch/index.js.map +1 -1
  156. package/sdk/dist/svm/venues/stabble-common.d.ts +1 -1
  157. package/sdk/dist/svm/venues/stabble-common.js +1 -1
  158. package/sdk/dist/svm/venues/types.d.ts +4 -1
  159. package/sdk/dist/svm/venues/types.d.ts.map +1 -1
  160. package/sdk/dist/svm/venues/woofi/index.d.ts.map +1 -1
  161. package/sdk/dist/svm/venues/woofi/index.js +4 -0
  162. package/sdk/dist/svm/venues/woofi/index.js.map +1 -1
  163. package/sdk/dist/svm/verify.d.ts +27 -133
  164. package/sdk/dist/svm/verify.d.ts.map +1 -1
  165. package/sdk/dist/svm/verify.js +72 -139
  166. package/sdk/dist/svm/verify.js.map +1 -1
  167. package/sdk/dist/swap/index.d.ts +16 -59
  168. package/sdk/dist/swap/index.d.ts.map +1 -1
  169. package/sdk/dist/swap/index.js +16 -59
  170. package/sdk/dist/swap/index.js.map +1 -1
  171. package/sdk/dist/token/source.d.ts.map +1 -1
  172. package/sdk/dist/token/source.js +4 -1
  173. package/sdk/dist/token/source.js.map +1 -1
  174. package/sdk/dist/verify/decode.d.ts +6 -6
  175. package/sdk/dist/verify/decode.js +7 -7
  176. package/sdk/dist/verify/index.js +2 -2
  177. package/sdk/dist/verify/intent.js +2 -2
  178. package/sdk/dist/verify/vectors.d.ts +1 -1
  179. package/sdk/dist/verify/vectors.d.ts.map +1 -1
  180. package/sdk/dist/verify/vectors.js +2 -2
  181. package/sdk/dist/verify/vectors.js.map +1 -1
  182. package/sdk/dist/verify/wire.d.ts +5 -4
  183. package/sdk/dist/verify/wire.d.ts.map +1 -1
  184. package/sdk/dist/verify/wire.js +5 -4
  185. package/sdk/dist/verify/wire.js.map +1 -1
@@ -1,68 +1,25 @@
1
1
  /**
2
- * `@eco-incorp/sauce`'s `swap` module — E4.1, the universal swap adapter.
2
+ * EVM swap program builders for `@eco-incorp/sauce`.
3
3
  *
4
- * Lowers a chain-agnostic swap SPEC into the call(s) that execute it through the Sauce Router's
5
- * unified `swap(SwapParams)` entry point, keyed by `SwapPoolType`. Two layers, both pure/sync, no
6
- * compiler import (mirrors `sdk/src/recipes/index.ts`'s "every compile option stays explicit at the
7
- * call site" posture):
4
+ * `toSwapParams` normalizes a swap specification into the Sauce Router's `SwapParams` shape.
5
+ * `swapSource` emits a complete program; `swapCallStatement` emits a statement for composition.
6
+ * These helpers construct source synchronously and do not compile or send transactions.
8
7
  *
9
- * 1. {@link toSwapParams} — the whole normalization/sign/defaulting/guard decision, as a plain
10
- * `SwapParams` object (bigint scalars, exact ABI-declaration order). Independently useful for
11
- * an off-chain `viem.encodeFunctionData` call (e.g. a `quote()` simulation) or a test assertion.
12
- * 2. {@link swapCallStatement} / {@link swapSource} — pure string templating over that object,
13
- * producing SauceScript source. `swapSource` returns a complete `function main() { ... }`
14
- * program; `swapCallStatement` returns one bare statement for splicing into a larger program.
8
+ * Compile the generated source with `routes.compileSauceRoute`, supplying both `pot` and `engine`
9
+ * and `baseDirs: [...swap.SWAP_BASE_DIRS]`. The route compiler annotates a falling-through `main`
10
+ * as `void` before passing it to the compiler dependency.
15
11
  *
16
- * ## Composing with E3 (route.calls)
12
+ * A program calls the Router through `ctx.self()`, using the Pot's Router dispatch. Multiple
13
+ * specifications passed to `swapSource` become sequential swaps in one program and one cook.
14
+ * Separate compiled programs can be composed with
15
+ * `routes.buildSauceEvmCalls({ pot, engine, cooks: [swapHex, settleHex] })`.
17
16
  *
18
- * ```ts
19
- * import { routes, swap } from "@eco-incorp/sauce";
17
+ * The unified `swap()` path supports pool types 0..8. Pancake Infinity CL/Bin require different
18
+ * Router entry points and are rejected here. Callback data, when supported by the pool type,
19
+ * must be supplied as an already compiled program. This builder discards the swap's return
20
+ * values; enforce an output requirement with an explicit balance/delta check or settlement.
20
21
  *
21
- * // routes.compileSauceRoute, not the compiler directly: a generated `main` falls off the end and
22
- * // a raw compile rejects it with "`main` does not return on every path".
23
- * const { compiled } = routes.compileSauceRoute(
24
- * "base",
25
- * swap.swapSource({ poolType: swap.SwapPoolType.UniV3, pool, tokenIn, tokenOut, amountIn: 1_000n }),
26
- * { pot },
27
- * { baseDirs: swap.SWAP_BASE_DIRS },
28
- * );
29
- * // compiled.bytecode[0] -- 124 bytes for this spec
30
- * ```
31
- *
32
- * A v12 program's `swap()` call self-targets `ctx.self()` (Router entries are `onlySelf`); the
33
- * V12Pot's own `fallback` delegatecalls it into the v1 Router — see `V12Pot.sol`'s own header for
34
- * that mechanism. This module never rebuilds any of that seam, only emits the SauceScript that
35
- * exercises it.
36
- *
37
- * **One cook = one program** (`V12Pot.cook` takes exactly one): a multi-hop route is ONE
38
- * `swapSource([legA, legB, ...])` program with N sequential `swap()` statements, not N cooks. A
39
- * swap-then-settle composition is two separate `CallInput`s — `routes.buildSauceEvmCalls({ pot,
40
- * engine, cooks: [swapBlob, settleBlob] })`.
41
- *
42
- * ## Scope (this is a minimal first cut)
43
- *
44
- * - **Unified `swap()` only — poolType 0..8.** PancakeInfinity's CL/Bin pools (9/10) are not
45
- * dispatchable through `swap()` at all (`Router.sol` falls through to `revert SwapFailed()`); they
46
- * need their own `swapInfinityCL`/`swapInfinityBin` emitters and their own (NEGATIVE-required)
47
- * sign rule. `toSwapParams` throws a named error pointing here rather than emitting a program that
48
- * reverts on-chain. See {@link UndispatchablePoolType}.
49
- * - **No deposit/stake/wrap/bridge (E4.2).** Those lower to direct `approve` + per-protocol calls
50
- * against the SDK's protocol registry — a different shape (a registry, not one entry point).
51
- * - **No callback-free direct-SauceScript alternative.** V2/Curve/BalancerV2/DODOV2/TraderJoeLB/
52
- * WOOFi (see {@link isCallbackFree}) MAY be replicated as `transfer` + `pool.swap` SauceScript,
53
- * bypassing the Router's fallback-delegatecall hop — this module always routes through the
54
- * unified `swap()` for all nine dispatchable types uniformly. Deferred; the predicate is exported
55
- * now so the follow-up has it.
56
- * - **No Tier-1 flash-fragment construction.** `spec.callback` is accepted and guarded (see
57
- * {@link isCallbackVenue}) but never built — it is an opaque, already-compiled program the caller
58
- * supplies.
59
- * - **No return-value decoding.** `swap()`'s `(int256 amount0, int256 amount1)` is emitted as a bare
60
- * discarded call; recovering `amountOut` needs direction-dependent delta selection. The intended
61
- * composition is `swap` cook → `settle.sauce.ts` cook, whose `minOut` floor is the real output
62
- * guard.
63
- * - **EVM/v12 only**, same posture as `sdk/src/recipes/`. The Sauce Router itself is EVM-only.
64
- *
65
- * See `docs/plans/2026-08-08-universal-interfaces-epic.md` for the wider epic this is E4.1 of.
22
+ * See `docs/guides/builders-and-actions.md` for public usage and composition examples.
66
23
  */
67
24
  export { SwapPoolType, UndispatchablePoolType, ZERO_POOL_KEY, SWAP_PARAMS_FIELDS, POOL_KEY_FIELDS, isCallbackVenue, isCallbackFree, usesPoolKey, } from "./types.js";
68
25
  export type { Address, Hex, AddressInput, AmountInput, PoolKey, PoolKeyInput, SwapSpec, SwapSourceSpec, SwapParams, } from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/swap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,OAAO,EACP,GAAG,EACH,YAAY,EACZ,WAAW,EACX,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7F,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/swap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,OAAO,EACP,GAAG,EACH,YAAY,EACZ,WAAW,EACX,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7F,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,68 +1,25 @@
1
1
  /**
2
- * `@eco-incorp/sauce`'s `swap` module — E4.1, the universal swap adapter.
2
+ * EVM swap program builders for `@eco-incorp/sauce`.
3
3
  *
4
- * Lowers a chain-agnostic swap SPEC into the call(s) that execute it through the Sauce Router's
5
- * unified `swap(SwapParams)` entry point, keyed by `SwapPoolType`. Two layers, both pure/sync, no
6
- * compiler import (mirrors `sdk/src/recipes/index.ts`'s "every compile option stays explicit at the
7
- * call site" posture):
4
+ * `toSwapParams` normalizes a swap specification into the Sauce Router's `SwapParams` shape.
5
+ * `swapSource` emits a complete program; `swapCallStatement` emits a statement for composition.
6
+ * These helpers construct source synchronously and do not compile or send transactions.
8
7
  *
9
- * 1. {@link toSwapParams} — the whole normalization/sign/defaulting/guard decision, as a plain
10
- * `SwapParams` object (bigint scalars, exact ABI-declaration order). Independently useful for
11
- * an off-chain `viem.encodeFunctionData` call (e.g. a `quote()` simulation) or a test assertion.
12
- * 2. {@link swapCallStatement} / {@link swapSource} — pure string templating over that object,
13
- * producing SauceScript source. `swapSource` returns a complete `function main() { ... }`
14
- * program; `swapCallStatement` returns one bare statement for splicing into a larger program.
8
+ * Compile the generated source with `routes.compileSauceRoute`, supplying both `pot` and `engine`
9
+ * and `baseDirs: [...swap.SWAP_BASE_DIRS]`. The route compiler annotates a falling-through `main`
10
+ * as `void` before passing it to the compiler dependency.
15
11
  *
16
- * ## Composing with E3 (route.calls)
12
+ * A program calls the Router through `ctx.self()`, using the Pot's Router dispatch. Multiple
13
+ * specifications passed to `swapSource` become sequential swaps in one program and one cook.
14
+ * Separate compiled programs can be composed with
15
+ * `routes.buildSauceEvmCalls({ pot, engine, cooks: [swapHex, settleHex] })`.
17
16
  *
18
- * ```ts
19
- * import { routes, swap } from "@eco-incorp/sauce";
17
+ * The unified `swap()` path supports pool types 0..8. Pancake Infinity CL/Bin require different
18
+ * Router entry points and are rejected here. Callback data, when supported by the pool type,
19
+ * must be supplied as an already compiled program. This builder discards the swap's return
20
+ * values; enforce an output requirement with an explicit balance/delta check or settlement.
20
21
  *
21
- * // routes.compileSauceRoute, not the compiler directly: a generated `main` falls off the end and
22
- * // a raw compile rejects it with "`main` does not return on every path".
23
- * const { compiled } = routes.compileSauceRoute(
24
- * "base",
25
- * swap.swapSource({ poolType: swap.SwapPoolType.UniV3, pool, tokenIn, tokenOut, amountIn: 1_000n }),
26
- * { pot },
27
- * { baseDirs: swap.SWAP_BASE_DIRS },
28
- * );
29
- * // compiled.bytecode[0] -- 124 bytes for this spec
30
- * ```
31
- *
32
- * A v12 program's `swap()` call self-targets `ctx.self()` (Router entries are `onlySelf`); the
33
- * V12Pot's own `fallback` delegatecalls it into the v1 Router — see `V12Pot.sol`'s own header for
34
- * that mechanism. This module never rebuilds any of that seam, only emits the SauceScript that
35
- * exercises it.
36
- *
37
- * **One cook = one program** (`V12Pot.cook` takes exactly one): a multi-hop route is ONE
38
- * `swapSource([legA, legB, ...])` program with N sequential `swap()` statements, not N cooks. A
39
- * swap-then-settle composition is two separate `CallInput`s — `routes.buildSauceEvmCalls({ pot,
40
- * engine, cooks: [swapBlob, settleBlob] })`.
41
- *
42
- * ## Scope (this is a minimal first cut)
43
- *
44
- * - **Unified `swap()` only — poolType 0..8.** PancakeInfinity's CL/Bin pools (9/10) are not
45
- * dispatchable through `swap()` at all (`Router.sol` falls through to `revert SwapFailed()`); they
46
- * need their own `swapInfinityCL`/`swapInfinityBin` emitters and their own (NEGATIVE-required)
47
- * sign rule. `toSwapParams` throws a named error pointing here rather than emitting a program that
48
- * reverts on-chain. See {@link UndispatchablePoolType}.
49
- * - **No deposit/stake/wrap/bridge (E4.2).** Those lower to direct `approve` + per-protocol calls
50
- * against the SDK's protocol registry — a different shape (a registry, not one entry point).
51
- * - **No callback-free direct-SauceScript alternative.** V2/Curve/BalancerV2/DODOV2/TraderJoeLB/
52
- * WOOFi (see {@link isCallbackFree}) MAY be replicated as `transfer` + `pool.swap` SauceScript,
53
- * bypassing the Router's fallback-delegatecall hop — this module always routes through the
54
- * unified `swap()` for all nine dispatchable types uniformly. Deferred; the predicate is exported
55
- * now so the follow-up has it.
56
- * - **No Tier-1 flash-fragment construction.** `spec.callback` is accepted and guarded (see
57
- * {@link isCallbackVenue}) but never built — it is an opaque, already-compiled program the caller
58
- * supplies.
59
- * - **No return-value decoding.** `swap()`'s `(int256 amount0, int256 amount1)` is emitted as a bare
60
- * discarded call; recovering `amountOut` needs direction-dependent delta selection. The intended
61
- * composition is `swap` cook → `settle.sauce.ts` cook, whose `minOut` floor is the real output
62
- * guard.
63
- * - **EVM/v12 only**, same posture as `sdk/src/recipes/`. The Sauce Router itself is EVM-only.
64
- *
65
- * See `docs/plans/2026-08-08-universal-interfaces-epic.md` for the wider epic this is E4.1 of.
22
+ * See `docs/guides/builders-and-actions.md` for public usage and composition examples.
66
23
  */
67
24
  export { SwapPoolType, UndispatchablePoolType, ZERO_POOL_KEY, SWAP_PARAMS_FIELDS, POOL_KEY_FIELDS, isCallbackVenue, isCallbackFree, usesPoolKey, } from "./types.js";
68
25
  export { toSwapParams, amountSpecifiedFor } from "./params.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/swap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AAapB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/swap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AAapB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/token/source.ts"],"names":[],"mappings":"AAcA,OAAO,EAQL,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAQlB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzD;;4EAE4E;AAC5E,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAA4B,CAAC;AAQ1E;;2EAE2E;AAC3E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,EAAE,WAAW,GAClB,SAAS,MAAM,EAAE,CAGnB;AAED;;;oGAGoG;AACpG,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,WAAW,EACnB,KAAK,SAAI,EACT,QAAQ,CAAC,EAAE,YAAY,GACtB,MAAM,CAiBR;AAED;sEACsE;AACtE,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAQ5E;AAED;;iFAEiF;AACjF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,MAAM,EAAE,CAOxF;AAED,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MA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EAAE,EACtC,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE,kBAAuB,GAC5B,MAAM,CAoCR"}
@@ -101,7 +101,10 @@ export function tokenSource(spec, target, opts = {}) {
101
101
  .join("\n");
102
102
  // Every SVM account is a main() param, in attach order — that declaration IS the manifest.
103
103
  const params = isEvmTarget(target) ? "" : svmAccountParamList(specs);
104
- const parts = [...importLines, "", `function ${fnName}(${params}) {`, body, "}", ""];
104
+ // SVM consumers compile directly to retain the account manifest. EVM source stays plain JS for
105
+ // the route wrapper's accessor parser, whose compiler adapter supplies its void annotation.
106
+ const returnType = !isEvmTarget(target) && specs[specs.length - 1].op !== "balanceOf" ? ": void" : "";
107
+ const parts = [...importLines, "", `function ${fnName}(${params})${returnType} {`, body, "}", ""];
105
108
  return parts.join("\n");
106
109
  }
107
110
  //# sourceMappingURL=source.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/token/source.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,GAEjB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D;;4EAE4E;AAC5E,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,IAAI,CAAC,SAA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AAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACrE,+FAA+F;IAC/F,4FAA4F;IAC5F,MAAM,UAAU,GACd,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,EAAE,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,MAAM,KAAK,GAAG,CAAC,GAAG,WAAW,EAAE,EAAE,EAAE,YAAY,MAAM,IAAI,MAAM,IAAI,UAAU,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IAClG,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ```
10
10
  * payload := program , args
11
- * program := 362 bytes ; SETTLE_WIRE.PROGRAM_BYTES — invariant
11
+ * program := 356 bytes ; SETTLE_WIRE.PROGRAM_BYTES — invariant
12
12
  * args := head , token_array
13
13
  * head := tokens_ptr , minout , recipient ; three 32-byte big-endian words
14
14
  * tokens_ptr := word, value = 96 ; byte offset WITHIN args of token_array
@@ -49,7 +49,7 @@
49
49
  *
50
50
  * WHAT THIS PROVES. `decodeSettleProgram` is STRUCTURAL: it pins the program's LENGTH and reads the
51
51
  * tail, so it tells you which `(tokens, minOut, recipient)` a payload carries and nothing about
52
- * what the 362 program bytes do. `validateSettleProgram` adds the authenticity half — one
52
+ * what the 356 program bytes do. `validateSettleProgram` adds the authenticity half — one
53
53
  * `keccak256` over the WHOLE program against `SETTLE_WIRE.PROGRAM_HASH` — and that is now a
54
54
  * complete answer rather than a partial one: because the arguments left the program, a matching
55
55
  * hash means the payload runs the audited `settle.sauce.ts` and nothing else — a statement about
@@ -163,18 +163,18 @@ export declare function bestEffortDecode(parse: SettleParse): DecodedSettleProgr
163
163
  * dirty upper bytes, and a zero recipient — see §4 for why. Throws `SettleDecodeError` (carrying a
164
164
  * stable `.code`) on any of the failures in `SettleFailureCode`.
165
165
  *
166
- * This is a STRUCTURAL decode: it proves the payload is `362 bytes || a canonical argument tail`.
167
- * It does NOT prove those 362 bytes are the settle program you audited — any 362-byte prefix
166
+ * This is a STRUCTURAL decode: it proves the payload is `356 bytes || a canonical argument tail`.
167
+ * It does NOT prove those 356 bytes are the settle program you audited — any 356-byte prefix
168
168
  * passes. Use `validateSettleProgram` when that matters, which is nearly always.
169
169
  */
170
170
  export declare function decodeSettleProgram(payload: Hex, programBytes?: number): DecodedSettleProgram;
171
171
  /**
172
- * `decodeSettleProgram` plus the authenticity pin: the payload's 362 program bytes must hash to
172
+ * `decodeSettleProgram` plus the authenticity pin: the payload's 356 program bytes must hash to
173
173
  * `SETTLE_WIRE.PROGRAM_HASH`. Because the arguments no longer live inside the program, a match
174
174
  * means the payload runs the audited `recipes/settle.sauce.ts` and nothing else — the whole
175
175
  * question, not the structural half.
176
176
  *
177
- * Throws `SettleDecodeError` with code `PROGRAM_HASH` when the program is a different 362 bytes,
177
+ * Throws `SettleDecodeError` with code `PROGRAM_HASH` when the program is a different 356 bytes,
178
178
  * and whatever `decodeSettleProgram` would throw otherwise.
179
179
  *
180
180
  * `accepted` overrides the pin. The dependency is a caret range and `SETTLE_WIRE` documents that a
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ```
10
10
  * payload := program , args
11
- * program := 362 bytes ; SETTLE_WIRE.PROGRAM_BYTES — invariant
11
+ * program := 356 bytes ; SETTLE_WIRE.PROGRAM_BYTES — invariant
12
12
  * args := head , token_array
13
13
  * head := tokens_ptr , minout , recipient ; three 32-byte big-endian words
14
14
  * tokens_ptr := word, value = 96 ; byte offset WITHIN args of token_array
@@ -49,7 +49,7 @@
49
49
  *
50
50
  * WHAT THIS PROVES. `decodeSettleProgram` is STRUCTURAL: it pins the program's LENGTH and reads the
51
51
  * tail, so it tells you which `(tokens, minOut, recipient)` a payload carries and nothing about
52
- * what the 362 program bytes do. `validateSettleProgram` adds the authenticity half — one
52
+ * what the 356 program bytes do. `validateSettleProgram` adds the authenticity half — one
53
53
  * `keccak256` over the WHOLE program against `SETTLE_WIRE.PROGRAM_HASH` — and that is now a
54
54
  * complete answer rather than a partial one: because the arguments left the program, a matching
55
55
  * hash means the payload runs the audited `settle.sauce.ts` and nothing else — a statement about
@@ -290,8 +290,8 @@ export function bestEffortDecode(parse) {
290
290
  * dirty upper bytes, and a zero recipient — see §4 for why. Throws `SettleDecodeError` (carrying a
291
291
  * stable `.code`) on any of the failures in `SettleFailureCode`.
292
292
  *
293
- * This is a STRUCTURAL decode: it proves the payload is `362 bytes || a canonical argument tail`.
294
- * It does NOT prove those 362 bytes are the settle program you audited — any 362-byte prefix
293
+ * This is a STRUCTURAL decode: it proves the payload is `356 bytes || a canonical argument tail`.
294
+ * It does NOT prove those 356 bytes are the settle program you audited — any 356-byte prefix
295
295
  * passes. Use `validateSettleProgram` when that matters, which is nearly always.
296
296
  */
297
297
  export function decodeSettleProgram(payload, programBytes = SETTLE_WIRE.PROGRAM_BYTES) {
@@ -307,12 +307,12 @@ export function decodeSettleProgram(payload, programBytes = SETTLE_WIRE.PROGRAM_
307
307
  return decoded;
308
308
  }
309
309
  /**
310
- * `decodeSettleProgram` plus the authenticity pin: the payload's 362 program bytes must hash to
310
+ * `decodeSettleProgram` plus the authenticity pin: the payload's 356 program bytes must hash to
311
311
  * `SETTLE_WIRE.PROGRAM_HASH`. Because the arguments no longer live inside the program, a match
312
312
  * means the payload runs the audited `recipes/settle.sauce.ts` and nothing else — the whole
313
313
  * question, not the structural half.
314
314
  *
315
- * Throws `SettleDecodeError` with code `PROGRAM_HASH` when the program is a different 362 bytes,
315
+ * Throws `SettleDecodeError` with code `PROGRAM_HASH` when the program is a different 356 bytes,
316
316
  * and whatever `decodeSettleProgram` would throw otherwise.
317
317
  *
318
318
  * `accepted` overrides the pin. The dependency is a caret range and `SETTLE_WIRE` documents that a
@@ -347,7 +347,7 @@ export function validateSettleProgram(payload, accepted = [
347
347
  // That precedence is the guarantee, and it is the whole of it. Among parse errors there is no such
348
348
  // ordering: each is an artefact of the candidate that produced it, and the FIRST supplied pin's is
349
349
  // the one reported -- so with several pins and no match at all, the code can still differ by pin
350
- // order (a 362-byte program read at 338 reports TOKENS_OFFSET where reading it at 362 reports
350
+ // order (a 356-byte program read at 338 reports TOKENS_OFFSET where reading it at 356 reports
351
351
  // ARGS_TRUNCATED). Diagnostic only: through `intent.ts` every one of them collapses to `null`, and
352
352
  // with a single pin -- the default and common case -- there is no order to depend on.
353
353
  let hashMismatch = null;
@@ -10,14 +10,14 @@
10
10
  // WHICH PROGRAMS. The settle program this decodes is what the PUBLISHED RUST COMPILER emits for
11
11
  // `recipes/settle.sauce.ts` — the only compiler this package ships against. `main` takes
12
12
  // `(tokens, minOut, recipient)` as RUNTIME entry arguments, so the compiled program is a
13
- // 362-byte constant and the arguments ride the payload AFTER it, as 32-byte big-endian words the
13
+ // 356-byte constant and the arguments ride the payload AFTER it, as 32-byte big-endian words the
14
14
  // engine reads back through CALLDATA. `SETTLE_VECTORS` is the conformance corpus and
15
15
  // `verify.compile.test.ts` recompiles the program and re-pins it on every run.
16
16
  //
17
17
  // SCOPE, stated plainly, in two tiers:
18
18
  // • `decodeSettleProgram` is STRUCTURAL. It pins the program's LENGTH and reads the argument tail,
19
19
  // so it names the tokens, floor and recipient a payload carries and nothing about what those
20
- // 362 bytes do. It is strict about the encoding (§4 of decode.ts: the canonical tokens pointer,
20
+ // 356 bytes do. It is strict about the encoding (§4 of decode.ts: the canonical tokens pointer,
21
21
  // no trailing slack, no dirty bytes above an address, a nonzero recipient), so an accepted
22
22
  // payload is the UNIQUE byte encoding of the values it decodes to.
23
23
  // • `validateSettleProgram` adds the authenticity half: one `keccak256` over the WHOLE program
@@ -10,10 +10,10 @@
10
10
  // Same dependency contract as decode.ts: `viem` ONLY (no compiler, no node, no artifact resolution), so
11
11
  // this stays safe to import in a browser or edge runtime.
12
12
  //
13
- // IDENTIFICATION IS BY PROGRAM HASH. An ingredient is taken as the settle when its leading 362 bytes
13
+ // IDENTIFICATION IS BY PROGRAM HASH. An ingredient is taken as the settle when its leading 356 bytes
14
14
  // hash to `SETTLE_WIRE.PROGRAM_HASH` and its tail is canonical — `validateSettleProgram`, not the
15
15
  // structural `decodeSettleProgram`. Under the v1 grammar the prologue's shape was itself the
16
- // signature; a length pin alone is a far weaker one, since ANY 362-byte prefix followed by a
16
+ // signature; a length pin alone is a far weaker one, since ANY 356-byte prefix followed by a
17
17
  // well-formed tail would decode. The hash is both stronger and simpler, and it is available at all
18
18
  // only because the arguments left the program — so what these helpers return is now "the audited
19
19
  // settle, with these params", not "something settle-shaped, params unverified".
@@ -1,7 +1,7 @@
1
1
  import type { Hex } from "viem";
2
2
  import type { SettleFailureCode } from "./decode.js";
3
3
  /**
4
- * The compiled `recipes/settle.sauce.ts` program — 362 bytes, measured by compiling it with the
4
+ * The compiled `recipes/settle.sauce.ts` program — 356 bytes, measured by compiling it with the
5
5
  * published Rust compiler (`@eco-incorp/sauce-compiler`) against the package's own
6
6
  * `artifacts/IERC20.json`.
7
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"vectors.d.ts","sourceRoot":"","sources":["../../src/verify/vectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,EAAE,GACosB,CAAC;AAEluB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,GAAG,CAAC;IACf,sGAAsG;IACtG,IAAI,EAAE,GAAG,CAAC;CACX;AAED;;;;;mFAKmF;AACnF,wBAAgB,aAAa,CAAC,IAAI,EAAE,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,EAAE,OAAO,CAAC;IACvB;;;iGAG6F;IAC7F,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EA4DvD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The compiled `recipes/settle.sauce.ts` program — 362 bytes, measured by compiling it with the
2
+ * The compiled `recipes/settle.sauce.ts` program — 356 bytes, measured by compiling it with the
3
3
  * published Rust compiler (`@eco-incorp/sauce-compiler`) against the package's own
4
4
  * `artifacts/IERC20.json`.
5
5
  *
@@ -8,7 +8,7 @@
8
8
  * compiler. That is the property the appended-args model rests on, and `verify.compile.test.ts` recompiles
9
9
  * this and compares — a LIVE pin, unlike the v1 corpus it replaces, whose compiler no longer exists.
10
10
  */
11
- export const SETTLE_PROGRAM = "0xa50201cad1514702000eb19000b6d002016a0120955402016a21d1d1d00120d4212295540240000120d22348020033b19000b60120d123012021d221d35147020046b19000b6d0012023d08a04ffffffff30e10120340a9220000000000000000031310100d2d146020070b10200adb00120d4210120d223e1210120d5210120d3230120e1e1e22121d3d3d151d14642020167b1d8e1e2e3e4d0e1e2e3e4e52295549b0101d121e1e0020065b0d402018a01209554e1e2e3e4e50201aa012095540100d4970100e1649401a0900470a082319602a3a10120970100d348020107b1d2d147020107b1901c736574746c653a2062616c616e63652062656c6f77206d696e4f7574b60100d551d146020115b1020158b0d0d6970100d1649401a0900470a082319602a3a10120970100d14802014cb10100d20100d3d89402a09004a9059cbb9602a2a1012097e00101d321e3e0e0e0020109b0e101208ae1d18905200000000031009000b6";
11
+ export const SETTLE_PROGRAM = "0xa50201c4d1514702000eb19000b6d00201640120955402016421d1d1d00120d4212295540240000120d22348020033b19000b60120d123012021d221d35147020046b19000b6d0012023d08a04ffffffff30e10120340a9220000000000000000031310100d2d146020070b10200a8b00120d4210120d223e1210120d5210120d3230120e1f12121d3d3d151d14642020161b1d8f1e3e4d0f1e3e4e52295549b0101e121020065b0d402018401209554f1e3e4e50201a4012095540100d4970100e1649401a0900470a082319602a3a10120970100d348020101b1d2d147020101b1901c736574746c653a2062616c616e63652062656c6f77206d696e4f7574b60100d551d14602010fb1020152b0d0d6970100d1649401a0900470a082319602a3a10120970100d148020146b10100d20100d3d89402a09004a9059cbb9602a2a1012097e00101d321e3e0e0e0020103b0e101208ae1d18905200000000031009000b6";
12
12
  /** The full on-the-wire payload for a vector's tail: `program || args`.
13
13
  *
14
14
  * Exported from `./verify`, so it takes a caller's hex rather than only this file's literals: an
@@ -1 +1 @@
1
- {"version":3,"file":"vectors.js","sourceRoot":"","sources":["../../src/verify/vectors.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,wtBAA+tB,CAAC;AAWluB;;;;;mFAKmF;AACnF,MAAM,UAAU,aAAa,CAAC,IAAS;IACrC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,UAAU,CAClB,mEAAmE,MAAM,CAAC,IAAI,CAAC,EAAE,CAClF,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAQ,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,GAAG,4CAAmD,CAAC,CAAC,YAAY;AAC3E,MAAM,CAAC,GAAG,4CAAmD,CAAC,CAAC,YAAY;AAC3E,MAAM,CAAC,GAAG,4CAAmD,CAAC,CAAC,qCAAqC;AACpG,MAAM,CAAC,GAAG,4CAAmD,CAAC,CAAC,WAAW;AAC1E,MAAM,CAAC,GAAG,4CAAmD,CAAC,CAAC,aAAa;AAE5E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAiC;IAC1D;QACE,IAAI,EAAE,oCAAoC;QAC1C,MAAM,EAAE,CAAC,CAAC,CAAC;QACX,MAAM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B;IACD;QACE,IAAI,EAAE,qDAAqD;QAC3D,IAAI,EAAE,oUAA2U;QACjV,IAAI,EAAE,gBAAgB;QACtB,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,KAAK;KACzB;IACD;QACE,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,oUAA2U;QACjV,IAAI,EAAE,gBAAgB;QACtB,kGAAkG;QAClG,gGAAgG;QAChG,6FAA6F;QAC7F,6FAA6F;QAC7F,wBAAwB;QACxB,aAAa,EAAE,IAAI;QACnB,iBAAiB,EAAE,KAAK;KACzB;IACD;QACE,IAAI,EAAE,qDAAqD;QAC3D,IAAI,EAAE,oQAA2Q;QACjR,IAAI,EAAE,cAAc;QACpB,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,KAAK;KACzB;CACF,CAAC"}
@@ -3,7 +3,7 @@ export declare const SETTLE_WIRE: {
3
3
  /** Byte length of the compiled `settle.sauce.ts` program. It is INVARIANT: the program takes its
4
4
  * `(tokens, minOut, recipient)` as runtime entry arguments, so nothing about the caller's values
5
5
  * reaches the compiler. This length is what locates the argument tail. */
6
- readonly PROGRAM_BYTES: 362;
6
+ readonly PROGRAM_BYTES: 356;
7
7
  /** Which compiler produced the bytes `PROGRAM_HASH` pins. The dependency is a caret range, and on
8
8
  * `^2.0.0` that is the whole `2.x` line — a far wider window than the `0.7.x` a `^0.7.0` caret
9
9
  * admitted, since a caret on `0.x` pins the minor. Any `2.x` that changes codegen makes a
@@ -23,15 +23,16 @@ export declare const SETTLE_WIRE: {
23
23
  * rather than a compiler change. 2.0.0 → 2.1.0 DID: 370 → 363, on the element/field write
24
24
  * boxing change. 2.1.0 → 2.2.0 DID too: 363 → 362, on the UNPACK opcode and the entry-argument
25
25
  * lowering it came with. 2.2.0 → 2.2.1 did NOT: its two compiler fixes both tighten what the
26
- * frontend REFUSES, so nothing this program already compiled to could move. So a compiler bump
26
+ * frontend REFUSES, so nothing this program already compiled to could move. 2.2.1 → 2.3.0
27
+ * DOES: 362 → 356, with a new hash after the optimizer updates. So a compiler bump
27
28
  * is not evidence either way: this string changes
28
29
  * every time, the hash only when the output does, and the tests above tell them apart. */
29
- readonly PROGRAM_COMPILER: "@eco-incorp/sauce-compiler@2.2.1";
30
+ readonly PROGRAM_COMPILER: "@eco-incorp/sauce-compiler@2.3.0";
30
31
  /** `keccak256` of those `PROGRAM_BYTES` bytes — the authenticity pin `validateSettleProgram`
31
32
  * enforces, and the reason a matching payload runs the audited program and nothing else.
32
33
  * Whole-program, not a body slice: program and arguments are disjoint byte regions on this wire.
33
34
  * `verify.compile.test.ts` recomputes it from source every run and fails before any consumer does. */
34
- readonly PROGRAM_HASH: "0x2da5c63da0ed3e934f4bb09985a38723de1f2a8e9a9a97ef3993e526cb649d11";
35
+ readonly PROGRAM_HASH: "0xf9fffd262b32ad0cb07f2748f813626363497e09e4f4da134bed1b8da0c5d5fe";
35
36
  /** Every argument word is 32 bytes, big-endian. */
36
37
  readonly WORD_BYTES: 32;
37
38
  /** An address occupies the LOW 20 bytes of its word; the upper 12 MUST be zero (§4). */
@@ -1 +1 @@
1
- {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/verify/wire.ts"],"names":[],"mappings":"AAkBA,yEAAyE;AACzE,eAAO,MAAM,WAAW;IACtB;;+EAE2E;;IAE3E;;;;;;;;;;;;;;;;;;;;;+FAqB2F;;IAE3F;;;2GAGuG;;IAEvG,mDAAmD;;IAEnD,wFAAwF;;IAExF,iGAAiG;;IAEjG;;8CAE0C;;CAElC,CAAC"}
1
+ {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/verify/wire.ts"],"names":[],"mappings":"AAkBA,yEAAyE;AACzE,eAAO,MAAM,WAAW;IACtB;;+EAE2E;;IAE3E;;;;;;;;;;;;;;;;;;;;;;+FAsB2F;;IAE3F;;;2GAGuG;;IAEvG,mDAAmD;;IAEnD,wFAAwF;;IAExF,iGAAiG;;IAEjG;;8CAE0C;;CAElC,CAAC"}
@@ -20,7 +20,7 @@ export const SETTLE_WIRE = {
20
20
  /** Byte length of the compiled `settle.sauce.ts` program. It is INVARIANT: the program takes its
21
21
  * `(tokens, minOut, recipient)` as runtime entry arguments, so nothing about the caller's values
22
22
  * reaches the compiler. This length is what locates the argument tail. */
23
- PROGRAM_BYTES: 362,
23
+ PROGRAM_BYTES: 356,
24
24
  /** Which compiler produced the bytes `PROGRAM_HASH` pins. The dependency is a caret range, and on
25
25
  * `^2.0.0` that is the whole `2.x` line — a far wider window than the `0.7.x` a `^0.7.0` caret
26
26
  * admitted, since a caret on `0.x` pins the minor. Any `2.x` that changes codegen makes a
@@ -40,15 +40,16 @@ export const SETTLE_WIRE = {
40
40
  * rather than a compiler change. 2.0.0 → 2.1.0 DID: 370 → 363, on the element/field write
41
41
  * boxing change. 2.1.0 → 2.2.0 DID too: 363 → 362, on the UNPACK opcode and the entry-argument
42
42
  * lowering it came with. 2.2.0 → 2.2.1 did NOT: its two compiler fixes both tighten what the
43
- * frontend REFUSES, so nothing this program already compiled to could move. So a compiler bump
43
+ * frontend REFUSES, so nothing this program already compiled to could move. 2.2.1 → 2.3.0
44
+ * DOES: 362 → 356, with a new hash after the optimizer updates. So a compiler bump
44
45
  * is not evidence either way: this string changes
45
46
  * every time, the hash only when the output does, and the tests above tell them apart. */
46
- PROGRAM_COMPILER: "@eco-incorp/sauce-compiler@2.2.1",
47
+ PROGRAM_COMPILER: "@eco-incorp/sauce-compiler@2.3.0",
47
48
  /** `keccak256` of those `PROGRAM_BYTES` bytes — the authenticity pin `validateSettleProgram`
48
49
  * enforces, and the reason a matching payload runs the audited program and nothing else.
49
50
  * Whole-program, not a body slice: program and arguments are disjoint byte regions on this wire.
50
51
  * `verify.compile.test.ts` recomputes it from source every run and fails before any consumer does. */
51
- PROGRAM_HASH: "0x2da5c63da0ed3e934f4bb09985a38723de1f2a8e9a9a97ef3993e526cb649d11",
52
+ PROGRAM_HASH: "0xf9fffd262b32ad0cb07f2748f813626363497e09e4f4da134bed1b8da0c5d5fe",
52
53
  /** Every argument word is 32 bytes, big-endian. */
53
54
  WORD_BYTES: 32,
54
55
  /** An address occupies the LOW 20 bytes of its word; the upper 12 MUST be zero (§4). */
@@ -1 +1 @@
1
- {"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/verify/wire.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,kGAAkG;AAClG,qEAAqE;AACrE,EAAE;AACF,0FAA0F;AAC1F,4FAA4F;AAC5F,EAAE;AACF,8FAA8F;AAC9F,oGAAoG;AACpG,kGAAkG;AAClG,mGAAmG;AACnG,kFAAkF;AAClF,EAAE;AACF,oGAAoG;AACpG,kGAAkG;AAClG,qGAAqG;AACrG,0FAA0F;AAE1F,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;;+EAE2E;IAC3E,aAAa,EAAE,GAAG;IAClB;;;;;;;;;;;;;;;;;;;;;+FAqB2F;IAC3F,gBAAgB,EAAE,kCAAkC;IACpD;;;2GAGuG;IACvG,YAAY,EAAE,oEAAoE;IAClF,mDAAmD;IACnD,UAAU,EAAE,EAAE;IACd,wFAAwF;IACxF,aAAa,EAAE,EAAE;IACjB,iGAAiG;IACjG,UAAU,EAAE,CAAC;IACb;;8CAE0C;IAC1C,UAAU,EAAE,EAAE;CACN,CAAC"}
1
+ {"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/verify/wire.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,kGAAkG;AAClG,qEAAqE;AACrE,EAAE;AACF,0FAA0F;AAC1F,4FAA4F;AAC5F,EAAE;AACF,8FAA8F;AAC9F,oGAAoG;AACpG,kGAAkG;AAClG,mGAAmG;AACnG,kFAAkF;AAClF,EAAE;AACF,oGAAoG;AACpG,kGAAkG;AAClG,qGAAqG;AACrG,0FAA0F;AAE1F,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;;+EAE2E;IAC3E,aAAa,EAAE,GAAG;IAClB;;;;;;;;;;;;;;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