@eco-incorp/sauce 0.99.1 → 0.99.3
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.
- package/LICENSE.md +29 -0
- package/README.md +69 -249
- package/actions/dist/to-sauce.d.ts.map +1 -1
- package/actions/dist/to-sauce.js +4 -5
- package/dev-tools/README.md +11 -170
- package/docs/README.md +39 -0
- package/docs/api/README.md +71 -0
- package/docs/api/compiler.md +234 -0
- package/docs/api/coverage.md +117 -0
- package/docs/api/routes.md +110 -0
- package/docs/concepts/architecture.md +134 -0
- package/docs/concepts/saucescript.md +172 -0
- package/docs/examples/README.md +34 -0
- package/docs/examples/compile-program.ts +20 -0
- package/docs/examples/evm-execution.ts +59 -0
- package/docs/examples/first-intent.ts +56 -0
- package/docs/examples/protocol-approval.ts +33 -0
- package/docs/guides/builders-and-actions.md +108 -0
- package/docs/guides/compiling.md +264 -0
- package/docs/guides/intents.md +158 -0
- package/docs/guides/nested-intents.md +79 -0
- package/docs/guides/protocols-and-tokens.md +116 -0
- package/docs/guides/quick-start.md +64 -0
- package/docs/guides/solana.md +199 -0
- package/docs/guides/verification.md +253 -0
- package/package.json +9 -4
- package/sdk/dist/artifacts/V12Deployments.json +23 -5
- package/sdk/dist/artifacts/V12RuntimeBytecode.json +1 -1
- package/sdk/dist/artifacts/svm/engine-devnet.so +0 -0
- package/sdk/dist/artifacts/svm/engine-mainnet.so +0 -0
- package/sdk/dist/artifacts/svm/engine-wire-devnet.json +18 -3
- package/sdk/dist/artifacts/svm/engine-wire-mainnet.json +18 -3
- package/sdk/dist/deployments/index.d.ts +14 -46
- package/sdk/dist/deployments/index.d.ts.map +1 -1
- package/sdk/dist/deployments/index.js +22 -47
- package/sdk/dist/deployments/index.js.map +1 -1
- package/sdk/dist/deployments/v12-addresses.d.ts +9 -5
- package/sdk/dist/deployments/v12-addresses.d.ts.map +1 -1
- package/sdk/dist/deployments/v12-addresses.js +5 -6
- package/sdk/dist/deployments/v12-addresses.js.map +1 -1
- package/sdk/dist/deployments/v12.generated.d.ts +3 -3
- package/sdk/dist/deployments/v12.generated.d.ts.map +1 -1
- package/sdk/dist/deployments/v12.generated.js +3 -3
- package/sdk/dist/deployments/v12.generated.js.map +1 -1
- package/sdk/dist/deposit/index.d.ts +28 -102
- package/sdk/dist/deposit/index.d.ts.map +1 -1
- package/sdk/dist/deposit/index.js.map +1 -1
- package/sdk/dist/deposit/params.d.ts +1 -1
- package/sdk/dist/deposit/params.js +2 -2
- package/sdk/dist/deposit/params.js.map +1 -1
- package/sdk/dist/deposit/source.d.ts +1 -1
- package/sdk/dist/deposit/source.d.ts.map +1 -1
- package/sdk/dist/deposit/source.js +18 -33
- package/sdk/dist/deposit/source.js.map +1 -1
- package/sdk/dist/deposit/types.d.ts +5 -4
- package/sdk/dist/deposit/types.d.ts.map +1 -1
- package/sdk/dist/evm/engine.d.ts +32 -0
- package/sdk/dist/evm/engine.d.ts.map +1 -1
- package/sdk/dist/evm/engine.js +2 -0
- package/sdk/dist/evm/engine.js.map +1 -1
- package/sdk/dist/index.d.ts +1 -0
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +2 -0
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/plugin/index.d.ts +16 -41
- package/sdk/dist/plugin/index.d.ts.map +1 -1
- package/sdk/dist/plugin/index.js +2 -6
- package/sdk/dist/plugin/index.js.map +1 -1
- package/sdk/dist/recipes/index.js +2 -2
- package/sdk/dist/recipes/settle.sauce.ts +1 -1
- package/sdk/dist/routes/index.d.ts +3 -3
- package/sdk/dist/routes/index.js +3 -3
- package/sdk/dist/routes/intent-dsl.d.ts +23 -10
- package/sdk/dist/routes/intent-dsl.d.ts.map +1 -1
- package/sdk/dist/routes/intent-dsl.js +19 -2
- package/sdk/dist/routes/intent-dsl.js.map +1 -1
- package/sdk/dist/routes/nest.d.ts +23 -0
- package/sdk/dist/routes/nest.d.ts.map +1 -1
- package/sdk/dist/routes/nest.js +2 -4
- package/sdk/dist/routes/nest.js.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.d.ts +2 -2
- package/sdk/dist/routes/protocol-rewrite.d.ts.map +1 -1
- package/sdk/dist/routes/protocol-rewrite.js +19 -35
- package/sdk/dist/routes/protocol-rewrite.js.map +1 -1
- package/sdk/dist/routes/sauce-calls.d.ts +7 -13
- package/sdk/dist/routes/sauce-calls.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-calls.js +6 -11
- package/sdk/dist/routes/sauce-calls.js.map +1 -1
- package/sdk/dist/routes/sauce-route.d.ts +24 -53
- package/sdk/dist/routes/sauce-route.d.ts.map +1 -1
- package/sdk/dist/routes/sauce-route.js +5 -6
- package/sdk/dist/routes/sauce-route.js.map +1 -1
- package/sdk/dist/routes/source-globals.generated.d.ts +931 -0
- package/sdk/dist/routes/source-globals.generated.d.ts.map +1 -0
- package/sdk/dist/routes/source-globals.generated.js +7 -0
- package/sdk/dist/routes/source-globals.generated.js.map +1 -0
- package/sdk/dist/std/token/token.svm.js +19 -14
- package/sdk/dist/svm/cpi-probe.d.ts +1 -1
- package/sdk/dist/svm/cpi-probe.d.ts.map +1 -1
- package/sdk/dist/svm/cpi-probe.js +5 -2
- package/sdk/dist/svm/cpi-probe.js.map +1 -1
- package/sdk/dist/svm/engine.d.ts +4 -3
- package/sdk/dist/svm/engine.d.ts.map +1 -1
- package/sdk/dist/svm/engine.js +4 -3
- package/sdk/dist/svm/engine.js.map +1 -1
- package/sdk/dist/svm/intent.d.ts +12 -40
- package/sdk/dist/svm/intent.d.ts.map +1 -1
- package/sdk/dist/svm/intent.js +22 -66
- package/sdk/dist/svm/intent.js.map +1 -1
- package/sdk/dist/svm/kitchen.d.ts.map +1 -1
- package/sdk/dist/svm/kitchen.js +3 -4
- package/sdk/dist/svm/kitchen.js.map +1 -1
- package/sdk/dist/svm/venues/byreal/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/byreal/index.js +4 -1
- package/sdk/dist/svm/venues/byreal/index.js.map +1 -1
- package/sdk/dist/svm/venues/carrot/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/carrot/index.js +4 -0
- package/sdk/dist/svm/venues/carrot/index.js.map +1 -1
- package/sdk/dist/svm/venues/cropper/index.d.ts +1 -1
- package/sdk/dist/svm/venues/cropper/index.js +1 -1
- package/sdk/dist/svm/venues/huma/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/huma/index.js +4 -1
- package/sdk/dist/svm/venues/huma/index.js.map +1 -1
- package/sdk/dist/svm/venues/index.d.ts +1 -0
- package/sdk/dist/svm/venues/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/index.js +1 -0
- package/sdk/dist/svm/venues/index.js.map +1 -1
- package/sdk/dist/svm/venues/math.d.ts +4 -1
- package/sdk/dist/svm/venues/math.d.ts.map +1 -1
- package/sdk/dist/svm/venues/math.js +4 -1
- package/sdk/dist/svm/venues/math.js.map +1 -1
- package/sdk/dist/svm/venues/meteora-damm-v1-stable/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/meteora-damm-v1-stable/index.js +4 -1
- package/sdk/dist/svm/venues/meteora-damm-v1-stable/index.js.map +1 -1
- package/sdk/dist/svm/venues/meteora-damm-v2/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/meteora-damm-v2/index.js +5 -2
- package/sdk/dist/svm/venues/meteora-damm-v2/index.js.map +1 -1
- package/sdk/dist/svm/venues/obric-v2/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/obric-v2/index.js +16 -5
- package/sdk/dist/svm/venues/obric-v2/index.js.map +1 -1
- package/sdk/dist/svm/venues/oracle-exponent.d.ts +82 -0
- package/sdk/dist/svm/venues/oracle-exponent.d.ts.map +1 -0
- package/sdk/dist/svm/venues/oracle-exponent.js +97 -0
- package/sdk/dist/svm/venues/oracle-exponent.js.map +1 -0
- package/sdk/dist/svm/venues/orca-legacy-token-swap/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/orca-legacy-token-swap/index.js +4 -1
- package/sdk/dist/svm/venues/orca-legacy-token-swap/index.js.map +1 -1
- package/sdk/dist/svm/venues/pumpswap/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/pumpswap/index.js +19 -13
- package/sdk/dist/svm/venues/pumpswap/index.js.map +1 -1
- package/sdk/dist/svm/venues/raydium-amm-v4/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/raydium-amm-v4/index.js +4 -1
- package/sdk/dist/svm/venues/raydium-amm-v4/index.js.map +1 -1
- package/sdk/dist/svm/venues/raydium-clmm/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/raydium-clmm/index.js +4 -1
- package/sdk/dist/svm/venues/raydium-clmm/index.js.map +1 -1
- package/sdk/dist/svm/venues/raydium-cp-swap/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/raydium-cp-swap/index.js +4 -1
- package/sdk/dist/svm/venues/raydium-cp-swap/index.js.map +1 -1
- package/sdk/dist/svm/venues/scorch/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/scorch/index.js +4 -1
- package/sdk/dist/svm/venues/scorch/index.js.map +1 -1
- package/sdk/dist/svm/venues/stabble-common.d.ts +1 -1
- package/sdk/dist/svm/venues/stabble-common.js +1 -1
- package/sdk/dist/svm/venues/types.d.ts +4 -1
- package/sdk/dist/svm/venues/types.d.ts.map +1 -1
- package/sdk/dist/svm/venues/woofi/index.d.ts.map +1 -1
- package/sdk/dist/svm/venues/woofi/index.js +4 -0
- package/sdk/dist/svm/venues/woofi/index.js.map +1 -1
- package/sdk/dist/svm/verify.d.ts +27 -133
- package/sdk/dist/svm/verify.d.ts.map +1 -1
- package/sdk/dist/svm/verify.js +72 -139
- package/sdk/dist/svm/verify.js.map +1 -1
- package/sdk/dist/swap/index.d.ts +16 -59
- package/sdk/dist/swap/index.d.ts.map +1 -1
- package/sdk/dist/swap/index.js +16 -59
- package/sdk/dist/swap/index.js.map +1 -1
- package/sdk/dist/token/source.d.ts.map +1 -1
- package/sdk/dist/token/source.js +4 -1
- package/sdk/dist/token/source.js.map +1 -1
- package/sdk/dist/verify/decode.d.ts +6 -6
- package/sdk/dist/verify/decode.js +7 -7
- package/sdk/dist/verify/index.js +2 -2
- package/sdk/dist/verify/intent.js +2 -2
- package/sdk/dist/verify/vectors.d.ts +1 -1
- package/sdk/dist/verify/vectors.d.ts.map +1 -1
- package/sdk/dist/verify/vectors.js +2 -2
- package/sdk/dist/verify/vectors.js.map +1 -1
- package/sdk/dist/verify/wire.d.ts +5 -4
- package/sdk/dist/verify/wire.d.ts.map +1 -1
- package/sdk/dist/verify/wire.js +5 -4
- package/sdk/dist/verify/wire.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/svm/verify.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/svm/verify.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,iGAAiG;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAgB,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErF,wGAAwG;AACxG,qGAAqG;AACrG,kEAAkE;AAClE,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,yBAAyB,EACzB,0BAA0B,GAW3B,MAAM,aAAa,CAAC;AAkCrB,gGAAgG;AAChG,SAAS,mBAAmB,CAAC,SAAiB;IAC5C,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAA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AS;YACX,CAAC,CAAC,4CAA4C,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAChF,CAAC;SAAM,CAAC;QACN,UAAU,GAAG,MAAM,CAAC;QACpB,OAAO,GAAG,KAAK,CAAC;QAChB,QAAQ;YACN,uFAAuF,CAAC;IAC5F,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,OAAO;QACP,UAAU;QACV,mBAAmB;QACnB,kBAAkB;QAClB,wBAAwB;QACxB,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/sdk/dist/swap/index.d.ts
CHANGED
|
@@ -1,68 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@eco-incorp/sauce
|
|
2
|
+
* EVM swap program builders for `@eco-incorp/sauce`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
19
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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"}
|
package/sdk/dist/swap/index.js
CHANGED
|
@@ -1,68 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@eco-incorp/sauce
|
|
2
|
+
* EVM swap program builders for `@eco-incorp/sauce`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
19
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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,KA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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,MAAM,CAAC;IACtB,iGAAiG;IACjG,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,SAAS,GAAG,SAAS,SAAS,EAAE,EACtC,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE,kBAAuB,GAC5B,MAAM,CAoCR"}
|
package/sdk/dist/token/source.js
CHANGED
|
@@ -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
|
-
|
|
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,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;AAE1E,SAAS,YAAY,CAAC,IAAe,EAAE,MAAmB;IACxD,IAAI,IAAI,CAAC,EAAE,KAAK,UAAU;QAAE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC1D,IAAI,IAAI,CAAC,EAAE,KAAK,SAAS;QAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;;QAC7D,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED;;2EAE2E;AAC3E,MAAM,UAAU,gBAAgB,CAC9B,KAA2B,EAC3B,MAAmB;IAEnB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;QAAE,OAAO,EA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
10
10
|
* payload := program , args
|
|
11
|
-
* program :=
|
|
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
|
|
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 `
|
|
167
|
-
* It does NOT prove those
|
|
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
|
|
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
|
|
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 :=
|
|
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
|
|
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 `
|
|
294
|
-
* It does NOT prove those
|
|
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
|
|
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
|
|
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
|
|
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;
|
package/sdk/dist/verify/index.js
CHANGED
|
@@ -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
|
-
//
|
|
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
|
-
//
|
|
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
|
|
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
|
|
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 —
|
|
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,
|
|
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,GACwrB,CAAC;AAEttB,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,GAAG,GAAG,GAAG,CAQ5C;AAQD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,iBAAiB,EAsBtD,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,6FAA6F;IAC7F,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,iBAAiB,CAAC;IACxB;;;;;;;;;;gFAU4E;IAC5E,aAAa,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 —
|
|
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 = "
|
|
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,
|
|
1
|
+
{"version":3,"file":"vectors.js","sourceRoot":"","sources":["../../src/verify/vectors.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,4sBAAmtB,CAAC;AAWttB;;;;;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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FAA+F;QAC/F,gGAAgG;QAChG,+FAA+F;QAC/F,6FAA6F;QAC7F,aAAa,EAAE,IAAI;QACnB,iBAAiB,EAAE,KAAK;KACzB;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:
|
|
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.
|
|
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.
|
|
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: "
|
|
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
|
|
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"}
|
package/sdk/dist/verify/wire.js
CHANGED
|
@@ -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:
|
|
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.
|
|
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.
|
|
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: "
|
|
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
|
|
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;;;;;;;;;;;;;;;;;;;;;;+FAsB2F;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"}
|