@bananapus/nana-sdk-core 2.41.2 → 3.0.0
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/dist/cjs/generated/juicebox.d.ts +122 -43
- package/dist/cjs/generated/juicebox.d.ts.map +1 -1
- package/dist/cjs/generated/juicebox.js +104 -43
- package/dist/cjs/generated/juicebox.js.map +1 -1
- package/dist/cjs/generated/stickySourceCollectors.d.ts +354 -0
- package/dist/cjs/generated/stickySourceCollectors.d.ts.map +1 -0
- package/dist/cjs/generated/stickySourceCollectors.js +391 -0
- package/dist/cjs/generated/stickySourceCollectors.js.map +1 -0
- package/dist/cjs/review/decode.js +1 -1
- package/dist/cjs/review/decode.js.map +1 -1
- package/dist/cjs/v6/index.d.ts +0 -1
- package/dist/cjs/v6/index.d.ts.map +1 -1
- package/dist/cjs/v6/index.js +0 -1
- package/dist/cjs/v6/index.js.map +1 -1
- package/dist/cjs/v6/pay.d.ts +89 -35
- package/dist/cjs/v6/pay.d.ts.map +1 -1
- package/dist/cjs/v6/pay.js +285 -41
- package/dist/cjs/v6/pay.js.map +1 -1
- package/dist/cjs/v6/sticky.d.ts +2 -2
- package/dist/cjs/v6/sticky.d.ts.map +1 -1
- package/dist/cjs/v6/sticky.js +5 -4
- package/dist/cjs/v6/sticky.js.map +1 -1
- package/dist/esm/generated/juicebox.d.ts +122 -43
- package/dist/esm/generated/juicebox.d.ts.map +1 -1
- package/dist/esm/generated/juicebox.js +104 -43
- package/dist/esm/generated/juicebox.js.map +1 -1
- package/dist/esm/generated/stickySourceCollectors.d.ts +354 -0
- package/dist/esm/generated/stickySourceCollectors.d.ts.map +1 -0
- package/dist/esm/generated/stickySourceCollectors.js +388 -0
- package/dist/esm/generated/stickySourceCollectors.js.map +1 -0
- package/dist/esm/review/decode.js +1 -1
- package/dist/esm/review/decode.js.map +1 -1
- package/dist/esm/v6/index.d.ts +0 -1
- package/dist/esm/v6/index.d.ts.map +1 -1
- package/dist/esm/v6/index.js +0 -1
- package/dist/esm/v6/index.js.map +1 -1
- package/dist/esm/v6/pay.d.ts +89 -35
- package/dist/esm/v6/pay.d.ts.map +1 -1
- package/dist/esm/v6/pay.js +285 -43
- package/dist/esm/v6/pay.js.map +1 -1
- package/dist/esm/v6/sticky.d.ts +2 -2
- package/dist/esm/v6/sticky.d.ts.map +1 -1
- package/dist/esm/v6/sticky.js +5 -4
- package/dist/esm/v6/sticky.js.map +1 -1
- package/package.json +1 -6
- package/dist/cjs/v6/directPay.d.ts +0 -69
- package/dist/cjs/v6/directPay.d.ts.map +0 -1
- package/dist/cjs/v6/directPay.js +0 -391
- package/dist/cjs/v6/directPay.js.map +0 -1
- package/dist/esm/v6/directPay.d.ts +0 -69
- package/dist/esm/v6/directPay.d.ts.map +0 -1
- package/dist/esm/v6/directPay.js +0 -385
- package/dist/esm/v6/directPay.js.map +0 -1
package/dist/cjs/v6/pay.d.ts
CHANGED
|
@@ -59,39 +59,16 @@ export interface PayPreview {
|
|
|
59
59
|
*/
|
|
60
60
|
reservedTokenCount: bigint;
|
|
61
61
|
}
|
|
62
|
-
export type PaySettlement = "issuance" | "swap";
|
|
63
|
-
export interface PayRouteCandidate extends PayPreview {
|
|
64
|
-
kind: "pay";
|
|
65
|
-
settlement: PaySettlement;
|
|
66
|
-
}
|
|
67
|
-
export interface DirectSwapRouteCandidate extends PayPreview {
|
|
68
|
-
kind: "direct-swap";
|
|
69
|
-
settlement: "swap";
|
|
70
|
-
quotedTokenCount: bigint;
|
|
71
|
-
}
|
|
72
|
-
export type BestPayRoute = PayRouteCandidate | DirectSwapRouteCandidate;
|
|
73
|
-
/**
|
|
74
|
-
* Pick the executable route which guarantees the beneficiary the most tokens.
|
|
75
|
-
*
|
|
76
|
-
* A direct pool swap bypasses the terminal, so its reserved token count is always
|
|
77
|
-
* zero. Its quote is reduced by `slippageBps` before comparison: a route is only
|
|
78
|
-
* selected when its on-chain minimum beats the terminal preview, not merely when
|
|
79
|
-
* its optimistic quote does.
|
|
80
|
-
*/
|
|
81
|
-
export declare function chooseBestPayRoute({ pay, paySettlement, directSwapQuote, slippageBps, }: {
|
|
82
|
-
pay: PayPreview;
|
|
83
|
-
paySettlement: PaySettlement;
|
|
84
|
-
directSwapQuote?: bigint | null;
|
|
85
|
-
slippageBps?: bigint;
|
|
86
|
-
}): BestPayRoute;
|
|
87
62
|
/**
|
|
88
|
-
* Preview the project tokens
|
|
89
|
-
* `previewPayFor(projectId, token, amount, beneficiary, metadata)`.
|
|
63
|
+
* Preview the project tokens a payment puts in the beneficiary's hands, via the
|
|
64
|
+
* terminal's `previewPayFor(projectId, token, amount, beneficiary, metadata)`.
|
|
90
65
|
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
66
|
+
* When the buyback hook wins the route, the terminal mints nothing itself and
|
|
67
|
+
* reports zero; the hook's pay specification carries the swap quote. This folds
|
|
68
|
+
* it in with the router terminal's scoring rule (see
|
|
69
|
+
* {@link effectivePayPreview}), for the hook the buyback registry resolves for
|
|
70
|
+
* the project, 1.4 or 1.1.1. The swap figure ignores pool fees and price
|
|
71
|
+
* impact, so use {@link prepareUserPay} for a payment's minimum.
|
|
95
72
|
*
|
|
96
73
|
* @param client A viem public client on the given chain.
|
|
97
74
|
* @param args.chainId The chain to preview on.
|
|
@@ -100,19 +77,71 @@ export declare function chooseBestPayRoute({ pay, paySettlement, directSwapQuote
|
|
|
100
77
|
* @param args.token The token being paid.
|
|
101
78
|
* @param args.amount The amount being paid, as a fixed point number with the token's
|
|
102
79
|
* decimals.
|
|
103
|
-
* @param args.beneficiary The address that would receive the
|
|
80
|
+
* @param args.beneficiary The address that would receive the project tokens.
|
|
104
81
|
* @param args.metadata Hook metadata. Defaults to "0x".
|
|
105
82
|
* @returns The previewed token counts.
|
|
106
83
|
*/
|
|
107
|
-
export declare function previewPay(client: PublicClient,
|
|
84
|
+
export declare function previewPay(client: PublicClient, args: PayArgs & {
|
|
85
|
+
metadata?: Hex;
|
|
86
|
+
}): Promise<PayPreview>;
|
|
87
|
+
interface PayArgs {
|
|
108
88
|
chainId: JBChainId;
|
|
109
89
|
terminal: Address;
|
|
110
90
|
projectId: bigint;
|
|
111
91
|
token: Address;
|
|
112
92
|
amount: bigint;
|
|
113
93
|
beneficiary: Address;
|
|
114
|
-
|
|
115
|
-
|
|
94
|
+
}
|
|
95
|
+
type PayHookSpecification = {
|
|
96
|
+
hook: Address;
|
|
97
|
+
noop: boolean;
|
|
98
|
+
metadata: Hex;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Fold the buyback hook's pay specification into a terminal preview, with the
|
|
102
|
+
* rule `JBPayRouteResolver._effectivePreviewPayTokenCounts` scores routes by.
|
|
103
|
+
* The swap leg uses the hook's raw quote: the TWAP price times the amount, with
|
|
104
|
+
* no pool fee or price impact. It is a ranking figure, not a minimum.
|
|
105
|
+
*/
|
|
106
|
+
export declare function effectivePayPreview({ buybackHook, beneficiaryTokenCount, reservedTokenCount, weight, reservedPercent, hookSpecifications, }: {
|
|
107
|
+
buybackHook: Address | null;
|
|
108
|
+
beneficiaryTokenCount: bigint;
|
|
109
|
+
reservedTokenCount: bigint;
|
|
110
|
+
weight: bigint;
|
|
111
|
+
/** The ruleset's reserved percent, for 1.1.1 specs. */
|
|
112
|
+
reservedPercent?: bigint;
|
|
113
|
+
hookSpecifications: readonly PayHookSpecification[];
|
|
114
|
+
}): PayPreview;
|
|
115
|
+
/** A pay card's whole payment: what to send, what to show, what to require. */
|
|
116
|
+
export interface PreparedUserPay {
|
|
117
|
+
metadata: Hex;
|
|
118
|
+
preview: PayPreview;
|
|
119
|
+
minReturnedTokens: bigint;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Prepare a person's payment with {@link buildUserPayMetadata}: preview it,
|
|
123
|
+
* and set the minimum the terminal enforces on the beneficiary's balance.
|
|
124
|
+
*
|
|
125
|
+
* When the project's buyback hook honors `skipSplits` and its pool is in the
|
|
126
|
+
* paid token, this quotes that pool (fee and price impact included) and sends
|
|
127
|
+
* the slippage-floored quote as an explicit minimum. The hook then swaps
|
|
128
|
+
* whenever the pool beats the payer's share of a mint, and reverts below the
|
|
129
|
+
* floor. Without it the hook routes by its TWAP floor, which reaches zero on
|
|
130
|
+
* large buys against a thin pool and sends them to minting even when the pool
|
|
131
|
+
* pays far more.
|
|
132
|
+
*
|
|
133
|
+
* Otherwise (no pool, hook 1.1.1, a router converting the token first, or a
|
|
134
|
+
* failed quote) the hook routes by TWAP. The minimum is then the payer's mint
|
|
135
|
+
* entitlement when the hook would swap, since the hook never settles below it,
|
|
136
|
+
* and the terminal's own issuance when it would not.
|
|
137
|
+
*
|
|
138
|
+
* @param args.slippageBps Tolerance on the pool quote and on the fallback
|
|
139
|
+
* minimum. Defaults to 100 (1%).
|
|
140
|
+
*/
|
|
141
|
+
export declare function prepareUserPay(client: PublicClient, { tiers, slippageBps, ...args }: PayArgs & {
|
|
142
|
+
tiers?: UserPayTiers;
|
|
143
|
+
slippageBps?: bigint;
|
|
144
|
+
}): Promise<PreparedUserPay>;
|
|
116
145
|
/**
|
|
117
146
|
* Build pay metadata instructing a project's JB721 tiers hook to mint specific tiers.
|
|
118
147
|
*
|
|
@@ -152,4 +181,29 @@ export declare function buildBuybackPayMetadata({ hook, amountToSwapWith, minimu
|
|
|
152
181
|
minimumSwapAmountOut: bigint;
|
|
153
182
|
skipSplits?: boolean;
|
|
154
183
|
}): Hex;
|
|
184
|
+
/** The 721 tiers a payment buys. */
|
|
185
|
+
export interface UserPayTiers {
|
|
186
|
+
metadataIdTarget: Address;
|
|
187
|
+
tierIdsToMint: bigint[];
|
|
188
|
+
allowOverspending?: boolean;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The pay metadata a person's pay card sends: the buyback registry's quote
|
|
192
|
+
* `(0, minimumSwapAmountOut, skipSplits=true)`, plus the 721 tiers when the
|
|
193
|
+
* payment buys NFTs. Prefer {@link prepareUserPay}, which picks the minimum.
|
|
194
|
+
*
|
|
195
|
+
* The registry rekeys its quote to the project's resolved hook. On buyback 1.4
|
|
196
|
+
* the hook buys from the pool only when that gives the payer more than their
|
|
197
|
+
* share of a mint, and hands the swapped tokens over without the reserved
|
|
198
|
+
* split. Minting still goes through the split. A zero swap amount swaps the
|
|
199
|
+
* whole payment. A zero minimum routes by the hook's TWAP floor; a nonzero one
|
|
200
|
+
* replaces it and reverts below it. The terminal's `minReturnedTokens` checks
|
|
201
|
+
* the beneficiary's balance change, which counts the swapped tokens.
|
|
202
|
+
*/
|
|
203
|
+
export declare function buildUserPayMetadata({ chainId, tiers, minimumSwapAmountOut, }: {
|
|
204
|
+
chainId: JBChainId;
|
|
205
|
+
tiers?: UserPayTiers;
|
|
206
|
+
minimumSwapAmountOut?: bigint;
|
|
207
|
+
}): Hex;
|
|
208
|
+
export {};
|
|
155
209
|
//# sourceMappingURL=pay.d.ts.map
|
package/dist/cjs/v6/pay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pay.d.ts","sourceRoot":"","sources":["../../../src/v6/pay.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"pay.d.ts","sourceRoot":"","sources":["../../../src/v6/pay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,GAAG,EACH,YAAY,EAGb,MAAM,MAAM,CAAC;AAMd,OAAO,EAEL,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,kBAAkB,CAAC;IAC/B,YAAY,EAAE,KAAK,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,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BAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,GAAG,CAUN;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,KAAK,EACL,oBAAyB,GAC1B,EAAE;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,GAAG,GAAG,CA0BN"}
|
package/dist/cjs/v6/pay.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildPayTx = buildPayTx;
|
|
4
|
-
exports.chooseBestPayRoute = chooseBestPayRoute;
|
|
5
4
|
exports.previewPay = previewPay;
|
|
5
|
+
exports.effectivePayPreview = effectivePayPreview;
|
|
6
|
+
exports.prepareUserPay = prepareUserPay;
|
|
6
7
|
exports.build721PayMetadata = build721PayMetadata;
|
|
7
8
|
exports.buildBuybackPayMetadata = buildBuybackPayMetadata;
|
|
9
|
+
exports.buildUserPayMetadata = buildUserPayMetadata;
|
|
8
10
|
const viem_1 = require("viem");
|
|
9
11
|
const constants_js_1 = require("../constants.js");
|
|
10
12
|
const juicebox_js_1 = require("../generated/juicebox.js");
|
|
13
|
+
const contracts_js_1 = require("../utils/contracts.js");
|
|
11
14
|
const hook_js_1 = require("../utils/hook.js");
|
|
15
|
+
const cashOut_js_1 = require("./cashOut.js");
|
|
16
|
+
const uniswapV4_js_1 = require("./uniswapV4.js");
|
|
12
17
|
/**
|
|
13
18
|
* Build a `pay(projectId, token, amount, beneficiary, minReturnedTokens, memo,
|
|
14
19
|
* metadata)` transaction request for a v6 terminal.
|
|
@@ -51,43 +56,15 @@ function buildPayTx({ chainId, terminal, projectId, token, amount, beneficiary,
|
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
/**
|
|
54
|
-
*
|
|
59
|
+
* Preview the project tokens a payment puts in the beneficiary's hands, via the
|
|
60
|
+
* terminal's `previewPayFor(projectId, token, amount, beneficiary, metadata)`.
|
|
55
61
|
*
|
|
56
|
-
*
|
|
57
|
-
* zero
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (slippageBps < 0n || slippageBps >= 10000n) {
|
|
63
|
-
throw new Error("slippageBps must be between 0 and 9,999.");
|
|
64
|
-
}
|
|
65
|
-
const payRoute = {
|
|
66
|
-
kind: "pay",
|
|
67
|
-
settlement: paySettlement,
|
|
68
|
-
...pay,
|
|
69
|
-
};
|
|
70
|
-
if (!directSwapQuote || directSwapQuote <= 0n)
|
|
71
|
-
return payRoute;
|
|
72
|
-
const minimum = (directSwapQuote * (10000n - slippageBps)) / 10000n;
|
|
73
|
-
if (minimum <= pay.beneficiaryTokenCount)
|
|
74
|
-
return payRoute;
|
|
75
|
-
return {
|
|
76
|
-
kind: "direct-swap",
|
|
77
|
-
settlement: "swap",
|
|
78
|
-
quotedTokenCount: directSwapQuote,
|
|
79
|
-
beneficiaryTokenCount: minimum,
|
|
80
|
-
reservedTokenCount: 0n,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Preview the project tokens minted by a payment, via the terminal's
|
|
85
|
-
* `previewPayFor(projectId, token, amount, beneficiary, metadata)`.
|
|
86
|
-
*
|
|
87
|
-
* The terminal's `previewPayFor` is used (rather than
|
|
88
|
-
* `JBTerminalStore.previewPayFrom`) because it takes exactly the data a `pay` caller
|
|
89
|
-
* already has — the store variant additionally requires a full `JBTokenAmount` tuple
|
|
90
|
-
* (token, decimals, currency, value), forcing an extra accounting-context lookup.
|
|
62
|
+
* When the buyback hook wins the route, the terminal mints nothing itself and
|
|
63
|
+
* reports zero; the hook's pay specification carries the swap quote. This folds
|
|
64
|
+
* it in with the router terminal's scoring rule (see
|
|
65
|
+
* {@link effectivePayPreview}), for the hook the buyback registry resolves for
|
|
66
|
+
* the project, 1.4 or 1.1.1. The swap figure ignores pool fees and price
|
|
67
|
+
* impact, so use {@link prepareUserPay} for a payment's minimum.
|
|
91
68
|
*
|
|
92
69
|
* @param client A viem public client on the given chain.
|
|
93
70
|
* @param args.chainId The chain to preview on.
|
|
@@ -96,18 +73,256 @@ function chooseBestPayRoute({ pay, paySettlement, directSwapQuote, slippageBps =
|
|
|
96
73
|
* @param args.token The token being paid.
|
|
97
74
|
* @param args.amount The amount being paid, as a fixed point number with the token's
|
|
98
75
|
* decimals.
|
|
99
|
-
* @param args.beneficiary The address that would receive the
|
|
76
|
+
* @param args.beneficiary The address that would receive the project tokens.
|
|
100
77
|
* @param args.metadata Hook metadata. Defaults to "0x".
|
|
101
78
|
* @returns The previewed token counts.
|
|
102
79
|
*/
|
|
103
|
-
async function previewPay(client,
|
|
104
|
-
|
|
80
|
+
async function previewPay(client, args) {
|
|
81
|
+
return (await readPay(client, args)).preview;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Decode a buyback pay specification: 17 words on 1.4, 15 on 1.1.1, which
|
|
85
|
+
* share the first 15. 1.1.1 has no `skipSplits` and reports no reserved
|
|
86
|
+
* percent, so the ruleset's is used.
|
|
87
|
+
*/
|
|
88
|
+
function decodeBuybackPaySpec(spec, rulesetReservedPercent) {
|
|
89
|
+
const words = (spec.metadata.length - 2) / 64;
|
|
90
|
+
if (words !== 15 && words < 17)
|
|
91
|
+
return null;
|
|
92
|
+
const word = (i) => `0x${spec.metadata.slice(2 + i * 64, 2 + (i + 1) * 64)}`;
|
|
93
|
+
const uint = (i) => BigInt(word(i));
|
|
94
|
+
return {
|
|
95
|
+
hook: spec.hook,
|
|
96
|
+
noop: spec.noop,
|
|
97
|
+
projectTokenIs0: uint(0) !== 0n,
|
|
98
|
+
amountToMintWith: uint(1),
|
|
99
|
+
minimumSwapAmountOut: uint(2),
|
|
100
|
+
tokenCountWithoutHook: uint(5),
|
|
101
|
+
weightRatio: uint(6),
|
|
102
|
+
amountToSwapWith: uint(7),
|
|
103
|
+
poolId: word(10),
|
|
104
|
+
rawSwapQuote: uint(13),
|
|
105
|
+
oracleUnseeded: uint(14) !== 0n,
|
|
106
|
+
skipSplits: words >= 17 && uint(15) !== 0n,
|
|
107
|
+
reservedPercent: words >= 17 ? uint(16) : rulesetReservedPercent,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** The controller's beneficiary share of a split mint, rounded the same way. */
|
|
111
|
+
function splitOf(tokenCount, reservedPercent) {
|
|
112
|
+
const max = BigInt(constants_js_1.MAX_RESERVED_PERCENT);
|
|
113
|
+
const beneficiaryTokenCount = (tokenCount * (max - reservedPercent)) / max;
|
|
114
|
+
return {
|
|
115
|
+
beneficiaryTokenCount,
|
|
116
|
+
reservedTokenCount: tokenCount - beneficiaryTokenCount,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/** Tokens the hook's direct-mint leg issues, as the hook computes them. */
|
|
120
|
+
function directMintOf(spec, weight) {
|
|
121
|
+
return spec.amountToMintWith !== 0n && spec.weightRatio !== 0n
|
|
122
|
+
? (spec.amountToMintWith * weight) / spec.weightRatio
|
|
123
|
+
: 0n;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Fold the buyback hook's pay specification into a terminal preview, with the
|
|
127
|
+
* rule `JBPayRouteResolver._effectivePreviewPayTokenCounts` scores routes by.
|
|
128
|
+
* The swap leg uses the hook's raw quote: the TWAP price times the amount, with
|
|
129
|
+
* no pool fee or price impact. It is a ranking figure, not a minimum.
|
|
130
|
+
*/
|
|
131
|
+
function effectivePayPreview({ buybackHook, beneficiaryTokenCount, reservedTokenCount, weight, reservedPercent = 0n, hookSpecifications, }) {
|
|
132
|
+
let best = { beneficiaryTokenCount, reservedTokenCount };
|
|
133
|
+
if (!buybackHook ||
|
|
134
|
+
beneficiaryTokenCount !== 0n ||
|
|
135
|
+
reservedTokenCount !== 0n) {
|
|
136
|
+
return best;
|
|
137
|
+
}
|
|
138
|
+
for (const spec of hookSpecifications) {
|
|
139
|
+
if (spec.noop || spec.hook.toLowerCase() !== buybackHook.toLowerCase()) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
const decoded = decodeBuybackPaySpec(spec, reservedPercent);
|
|
143
|
+
if (!decoded)
|
|
144
|
+
continue;
|
|
145
|
+
const directMintTokenCount = directMintOf(decoded, weight);
|
|
146
|
+
const swapTokenCount = !decoded.oracleUnseeded &&
|
|
147
|
+
decoded.rawSwapQuote > decoded.minimumSwapAmountOut
|
|
148
|
+
? decoded.rawSwapQuote
|
|
149
|
+
: decoded.minimumSwapAmountOut;
|
|
150
|
+
const candidate = splitOf(decoded.skipSplits
|
|
151
|
+
? directMintTokenCount
|
|
152
|
+
: swapTokenCount + directMintTokenCount, decoded.reservedPercent);
|
|
153
|
+
if (decoded.skipSplits)
|
|
154
|
+
candidate.beneficiaryTokenCount += swapTokenCount;
|
|
155
|
+
if (candidate.beneficiaryTokenCount > best.beneficiaryTokenCount ||
|
|
156
|
+
(candidate.beneficiaryTokenCount === best.beneficiaryTokenCount &&
|
|
157
|
+
candidate.reservedTokenCount > best.reservedTokenCount)) {
|
|
158
|
+
best = candidate;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return best;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* What the payer receives if the hook mints instead of swapping. The hook
|
|
165
|
+
* swaps only while the pool beats this rate, and unwinds to it when a swap
|
|
166
|
+
* underfills, so every honest settlement clears it.
|
|
167
|
+
*/
|
|
168
|
+
function mintEntitlementOf(spec, weight) {
|
|
169
|
+
const swapLeg = spec.skipSplits
|
|
170
|
+
? spec.tokenCountWithoutHook
|
|
171
|
+
: splitOf(spec.tokenCountWithoutHook, spec.reservedPercent)
|
|
172
|
+
.beneficiaryTokenCount;
|
|
173
|
+
return (swapLeg +
|
|
174
|
+
splitOf(directMintOf(spec, weight), spec.reservedPercent)
|
|
175
|
+
.beneficiaryTokenCount);
|
|
176
|
+
}
|
|
177
|
+
/** One terminal preview, with the project's buyback spec decoded. */
|
|
178
|
+
async function readPay(client, { chainId, terminal, projectId, token, amount, beneficiary, metadata = "0x", }) {
|
|
179
|
+
const [ruleset, beneficiaryTokenCount, reservedTokenCount, hookSpecifications,] = await client.readContract({
|
|
105
180
|
address: terminal,
|
|
106
181
|
abi: juicebox_js_1.jbMultiTerminalAbi,
|
|
107
182
|
functionName: "previewPayFor",
|
|
108
183
|
args: [projectId, token, amount, beneficiary, metadata],
|
|
109
184
|
});
|
|
110
|
-
|
|
185
|
+
// Only a payment with hook specs needs to know which one is the buyback hook.
|
|
186
|
+
const buybackHook = hookSpecifications.length > 0
|
|
187
|
+
? await resolvedBuybackHookOf(client, chainId, projectId)
|
|
188
|
+
: null;
|
|
189
|
+
const reservedPercent = (ruleset.metadata >> 4n) & 0xffffn;
|
|
190
|
+
const spec = buybackHook
|
|
191
|
+
? hookSpecifications.find((s) => s.hook.toLowerCase() === buybackHook.toLowerCase())
|
|
192
|
+
: undefined;
|
|
193
|
+
return {
|
|
194
|
+
preview: effectivePayPreview({
|
|
195
|
+
buybackHook,
|
|
196
|
+
beneficiaryTokenCount,
|
|
197
|
+
reservedTokenCount,
|
|
198
|
+
weight: ruleset.weight,
|
|
199
|
+
reservedPercent,
|
|
200
|
+
hookSpecifications,
|
|
201
|
+
}),
|
|
202
|
+
terminalBeneficiaryTokenCount: beneficiaryTokenCount,
|
|
203
|
+
weight: ruleset.weight,
|
|
204
|
+
buyback: spec ? decodeBuybackPaySpec(spec, reservedPercent) : null,
|
|
205
|
+
unreadableSwap: !!spec && !spec.noop && !decodeBuybackPaySpec(spec, reservedPercent),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/** The buyback hook the registry resolves for a project, or null. */
|
|
209
|
+
async function resolvedBuybackHookOf(client, chainId, projectId) {
|
|
210
|
+
let registry;
|
|
211
|
+
try {
|
|
212
|
+
registry = (0, contracts_js_1.getJBContractAddress)("JBBuybackHookRegistry", 6, chainId);
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
// A failed read throws: guessing "no hook" would drop the payment's minimum.
|
|
218
|
+
const hook = await client.readContract({
|
|
219
|
+
address: registry,
|
|
220
|
+
abi: juicebox_js_1.jbBuybackHookRegistryAbi,
|
|
221
|
+
functionName: "hookOf",
|
|
222
|
+
args: [projectId],
|
|
223
|
+
});
|
|
224
|
+
return hook === viem_1.zeroAddress ? null : hook;
|
|
225
|
+
}
|
|
226
|
+
const maxBigInt = (a, b) => (a > b ? a : b);
|
|
227
|
+
const poolKeyOfAbi = [
|
|
228
|
+
{
|
|
229
|
+
type: "function",
|
|
230
|
+
name: "poolKeyOf",
|
|
231
|
+
stateMutability: "view",
|
|
232
|
+
inputs: [
|
|
233
|
+
{ name: "projectId", type: "uint256" },
|
|
234
|
+
{ name: "terminalToken", type: "address" },
|
|
235
|
+
],
|
|
236
|
+
outputs: [
|
|
237
|
+
{
|
|
238
|
+
name: "key",
|
|
239
|
+
type: "tuple",
|
|
240
|
+
components: [
|
|
241
|
+
{ name: "currency0", type: "address" },
|
|
242
|
+
{ name: "currency1", type: "address" },
|
|
243
|
+
{ name: "fee", type: "uint24" },
|
|
244
|
+
{ name: "tickSpacing", type: "int24" },
|
|
245
|
+
{ name: "hooks", type: "address" },
|
|
246
|
+
],
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
];
|
|
251
|
+
/**
|
|
252
|
+
* Prepare a person's payment with {@link buildUserPayMetadata}: preview it,
|
|
253
|
+
* and set the minimum the terminal enforces on the beneficiary's balance.
|
|
254
|
+
*
|
|
255
|
+
* When the project's buyback hook honors `skipSplits` and its pool is in the
|
|
256
|
+
* paid token, this quotes that pool (fee and price impact included) and sends
|
|
257
|
+
* the slippage-floored quote as an explicit minimum. The hook then swaps
|
|
258
|
+
* whenever the pool beats the payer's share of a mint, and reverts below the
|
|
259
|
+
* floor. Without it the hook routes by its TWAP floor, which reaches zero on
|
|
260
|
+
* large buys against a thin pool and sends them to minting even when the pool
|
|
261
|
+
* pays far more.
|
|
262
|
+
*
|
|
263
|
+
* Otherwise (no pool, hook 1.1.1, a router converting the token first, or a
|
|
264
|
+
* failed quote) the hook routes by TWAP. The minimum is then the payer's mint
|
|
265
|
+
* entitlement when the hook would swap, since the hook never settles below it,
|
|
266
|
+
* and the terminal's own issuance when it would not.
|
|
267
|
+
*
|
|
268
|
+
* @param args.slippageBps Tolerance on the pool quote and on the fallback
|
|
269
|
+
* minimum. Defaults to 100 (1%).
|
|
270
|
+
*/
|
|
271
|
+
async function prepareUserPay(client, { tiers, slippageBps = 100n, ...args }) {
|
|
272
|
+
const { chainId, projectId, token } = args;
|
|
273
|
+
const metadata = buildUserPayMetadata({ chainId, tiers });
|
|
274
|
+
const { preview, terminalBeneficiaryTokenCount, weight, buyback, unreadableSwap, } = await readPay(client, { ...args, metadata });
|
|
275
|
+
if (unreadableSwap) {
|
|
276
|
+
throw new Error("The project's buyback hook swaps with an unknown specification, so no safe minimum can be set.");
|
|
277
|
+
}
|
|
278
|
+
const fallback = {
|
|
279
|
+
metadata,
|
|
280
|
+
preview,
|
|
281
|
+
minReturnedTokens: (0, cashOut_js_1.slippageFloor)(buyback && !buyback.noop
|
|
282
|
+
? // The swap and the leftover mint each round down once.
|
|
283
|
+
maxBigInt(mintEntitlementOf(buyback, weight) - 2n, 0n)
|
|
284
|
+
: terminalBeneficiaryTokenCount, slippageBps),
|
|
285
|
+
};
|
|
286
|
+
if (!buyback?.skipSplits || buyback.amountToSwapWith === 0n)
|
|
287
|
+
return fallback;
|
|
288
|
+
try {
|
|
289
|
+
const poolKey = await client.readContract({
|
|
290
|
+
address: buyback.hook,
|
|
291
|
+
abi: poolKeyOfAbi,
|
|
292
|
+
functionName: "poolKeyOf",
|
|
293
|
+
args: [
|
|
294
|
+
projectId,
|
|
295
|
+
token.toLowerCase() === constants_js_1.NATIVE_TOKEN.toLowerCase()
|
|
296
|
+
? viem_1.zeroAddress
|
|
297
|
+
: token,
|
|
298
|
+
],
|
|
299
|
+
});
|
|
300
|
+
// A router converts the paid token first, so its pool is a different one.
|
|
301
|
+
if ((0, uniswapV4_js_1.uniswapV4PoolId)(poolKey) !== buyback.poolId)
|
|
302
|
+
return fallback;
|
|
303
|
+
const quote = await (0, uniswapV4_js_1.quoteUniswapV4ExactInputSingle)(client, {
|
|
304
|
+
chainId,
|
|
305
|
+
poolKey,
|
|
306
|
+
zeroForOne: !buyback.projectTokenIs0,
|
|
307
|
+
amountIn: buyback.amountToSwapWith,
|
|
308
|
+
});
|
|
309
|
+
const minimumSwapAmountOut = (0, cashOut_js_1.slippageFloor)(quote, slippageBps);
|
|
310
|
+
// The pool loses to minting: leave the payment on the mint path.
|
|
311
|
+
if (minimumSwapAmountOut <= buyback.tokenCountWithoutHook)
|
|
312
|
+
return fallback;
|
|
313
|
+
const directMint = splitOf(directMintOf(buyback, weight), buyback.reservedPercent);
|
|
314
|
+
return {
|
|
315
|
+
metadata: buildUserPayMetadata({ chainId, tiers, minimumSwapAmountOut }),
|
|
316
|
+
preview: {
|
|
317
|
+
beneficiaryTokenCount: quote + directMint.beneficiaryTokenCount,
|
|
318
|
+
reservedTokenCount: directMint.reservedTokenCount,
|
|
319
|
+
},
|
|
320
|
+
minReturnedTokens: minimumSwapAmountOut,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
return fallback;
|
|
325
|
+
}
|
|
111
326
|
}
|
|
112
327
|
/**
|
|
113
328
|
* Build pay metadata instructing a project's JB721 tiers hook to mint specific tiers.
|
|
@@ -148,4 +363,33 @@ function buildBuybackPayMetadata({ hook, amountToSwapWith, minimumSwapAmountOut,
|
|
|
148
363
|
(0, viem_1.encodeAbiParameters)([{ type: "uint256" }, { type: "uint256" }, { type: "bool" }], [amountToSwapWith, minimumSwapAmountOut, skipSplits]),
|
|
149
364
|
]);
|
|
150
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* The pay metadata a person's pay card sends: the buyback registry's quote
|
|
368
|
+
* `(0, minimumSwapAmountOut, skipSplits=true)`, plus the 721 tiers when the
|
|
369
|
+
* payment buys NFTs. Prefer {@link prepareUserPay}, which picks the minimum.
|
|
370
|
+
*
|
|
371
|
+
* The registry rekeys its quote to the project's resolved hook. On buyback 1.4
|
|
372
|
+
* the hook buys from the pool only when that gives the payer more than their
|
|
373
|
+
* share of a mint, and hands the swapped tokens over without the reserved
|
|
374
|
+
* split. Minting still goes through the split. A zero swap amount swaps the
|
|
375
|
+
* whole payment. A zero minimum routes by the hook's TWAP floor; a nonzero one
|
|
376
|
+
* replaces it and reverts below it. The terminal's `minReturnedTokens` checks
|
|
377
|
+
* the beneficiary's balance change, which counts the swapped tokens.
|
|
378
|
+
*/
|
|
379
|
+
function buildUserPayMetadata({ chainId, tiers, minimumSwapAmountOut = 0n, }) {
|
|
380
|
+
const ids = [
|
|
381
|
+
(0, hook_js_1.hookMetadataId)((0, contracts_js_1.getJBContractAddress)("JBBuybackHookRegistry", 6, chainId), "pay"),
|
|
382
|
+
];
|
|
383
|
+
const data = [
|
|
384
|
+
(0, viem_1.encodeAbiParameters)([{ type: "uint256" }, { type: "uint256" }, { type: "bool" }], [0n, minimumSwapAmountOut, true]),
|
|
385
|
+
];
|
|
386
|
+
if (tiers && tiers.tierIdsToMint.length > 0) {
|
|
387
|
+
ids.push((0, hook_js_1.hookMetadataId)(tiers.metadataIdTarget, "pay"));
|
|
388
|
+
data.push((0, viem_1.encodeAbiParameters)([{ type: "bool" }, { type: "uint16[]" }], [
|
|
389
|
+
tiers.allowOverspending ?? constants_js_1.DEFAULT_ALLOW_OVERSPENDING,
|
|
390
|
+
tiers.tierIdsToMint.map(Number),
|
|
391
|
+
]));
|
|
392
|
+
}
|
|
393
|
+
return (0, hook_js_1.createHookMetadata)(ids, data);
|
|
394
|
+
}
|
|
151
395
|
//# sourceMappingURL=pay.js.map
|
package/dist/cjs/v6/pay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pay.js","sourceRoot":"","sources":["../../../src/v6/pay.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"pay.js","sourceRoot":"","sources":["../../../src/v6/pay.ts"],"names":[],"mappings":";;AA4DA,gCAuCC;AAsCD,gCAKC;AAwFD,kDAsDC;AA0JD,wCAyEC;AAsBD,kDA0BC;AAQD,0DAoBC;AAsBD,oDAkCC;AAnoBD,+BAMc;AACd,kDAIyB;AACzB,0DAGkC;AAElC,wDAA6D;AAC7D,8CAAsE;AACtE,6CAA6C;AAC7C,iDAGwB;AAexB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,UAAU,CAAC,EACzB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,WAAW,EACX,iBAAiB,GAAG,EAAE,EACtB,IAAI,GAAG,EAAE,EACT,QAAQ,GAAG,IAAI,GAWhB;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,KAAK,2BAAY,CAAC,WAAW,EAAE,CAAC;IAEpE,OAAO;QACL,OAAO;QACP,OAAO,EAAE,QAAQ;QACjB,GAAG,EAAE,gCAAkB;QACvB,YAAY,EAAE,KAAK;QACnB,IAAI,EAAE;YACJ,SAAS;YACT,KAAK;YACL,MAAM;YACN,WAAW;YACX,iBAAiB;YACjB,IAAI;YACJ,QAAQ;SACT;QACD,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;KAC9B,CAAC;AACJ,CAAC;AAgBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACI,KAAK,U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c,EACZ,IAAA,mCAAoB,EAAC,uBAAuB,EAAE,CAAC,EAAE,OAAO,CAAC,EACzD,KAAK,CACN;KACF,CAAC;IACF,MAAM,IAAI,GAAU;QAClB,IAAA,0BAAmB,EACjB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAC5D,CAAC,EAAE,EAAE,oBAAoB,EAAE,IAAI,CAAC,CACjC;KACF,CAAC;IACF,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,GAAG,CAAC,IAAI,CAAC,IAAA,wBAAc,EAAC,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,CACP,IAAA,0BAAmB,EACjB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EACxC;YACE,KAAK,CAAC,iBAAiB,IAAI,yCAA0B;YACrD,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC;SAChC,CACF,CACF,CAAC;IACJ,CAAC;IACD,OAAO,IAAA,4BAAkB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC"}
|
package/dist/cjs/v6/sticky.d.ts
CHANGED
|
@@ -287,7 +287,7 @@ export declare const stickySourceCollectorAbi: readonly [{
|
|
|
287
287
|
}];
|
|
288
288
|
}];
|
|
289
289
|
/**
|
|
290
|
-
* A reviewed, actually deployed collector and fee
|
|
290
|
+
* A reviewed, actually deployed collector and fee payer on one source chain.
|
|
291
291
|
* Obtain hashes and bindings from verified deployment artifacts, never predictions
|
|
292
292
|
* or the target's own getters. A destination family has one address across sources.
|
|
293
293
|
*/
|
|
@@ -303,7 +303,7 @@ export interface StickySourceCollectorDeployment {
|
|
|
303
303
|
directory: Address;
|
|
304
304
|
receiverFactory: Address;
|
|
305
305
|
}
|
|
306
|
-
/**
|
|
306
|
+
/** Verified source/home families generated from the pinned Sticky release. */
|
|
307
307
|
export declare const STICKY_SOURCE_COLLECTOR_DEPLOYMENTS: readonly StickySourceCollectorDeployment[];
|
|
308
308
|
/**
|
|
309
309
|
* Find a deployed source/home pair. Unknown or conflicting family records fail
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../../../src/v6/sticky.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAMP,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAUd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../../../src/v6/sticky.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAMP,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAUd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAIvD;;;;;;;;;;;;;;;;GAgBG;AAEH,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C,mEAAmE;AACnE,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,8EAA8E;AAC9E,wBAAgB,wBAAwB,CAAC,OAAO,E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,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACnE,KAAK,EAAE,MAAM,CAAC;CACf,CA2BA;AAED,wFAAwF;AACxF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,yBAAyB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GACnD;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,wBAAwB,CAAC;IACrC,YAAY,EAAE,QAAQ,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAClD,CAgBA;AAiED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,+BAA+B,GAC1C,OAAO,CAAC,IAAI,CAAC,CA+Df;AAED,qFAAqF;AACrF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,YAAY,EAC/B,IAAI,EAAE,yBAAyB,GAAG;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GACA,OAAO,CAAC,oBAAoB,CAAC,CAgR/B"}
|
package/dist/cjs/v6/sticky.js
CHANGED
|
@@ -53,6 +53,7 @@ const juicebox_js_1 = require("../generated/juicebox.js");
|
|
|
53
53
|
const pureConstants_js_1 = require("../pureConstants.js");
|
|
54
54
|
const splits_js_1 = require("./splits.js");
|
|
55
55
|
const types_js_1 = require("./types.js");
|
|
56
|
+
const stickySourceCollectors_js_1 = require("../generated/stickySourceCollectors.js");
|
|
56
57
|
/**
|
|
57
58
|
* A split routes funds to Sticky holders when its `hook` is the chain's
|
|
58
59
|
* `StickyDistributor`. The distributor reads the rest of the split this way:
|
|
@@ -543,8 +544,8 @@ const stickySuckerIdentityAbi = [
|
|
|
543
544
|
],
|
|
544
545
|
},
|
|
545
546
|
];
|
|
546
|
-
/**
|
|
547
|
-
exports.STICKY_SOURCE_COLLECTOR_DEPLOYMENTS =
|
|
547
|
+
/** Verified source/home families generated from the pinned Sticky release. */
|
|
548
|
+
exports.STICKY_SOURCE_COLLECTOR_DEPLOYMENTS = stickySourceCollectors_js_1.stickySourceCollectorDeployments;
|
|
548
549
|
/**
|
|
549
550
|
* Find a deployed source/home pair. Unknown or conflicting family records fail
|
|
550
551
|
* closed, including different addresses for the same destination on other sources.
|
|
@@ -923,8 +924,8 @@ async function verifyStickyCollectorRoute(sourceClient, destinationClient, args)
|
|
|
923
924
|
if (returnChain !== BigInt(deployment.sourceChainId) ||
|
|
924
925
|
!(0, viem_1.isAddressEqual)(suckerBytes32ToAddress(returnPeer), sucker))
|
|
925
926
|
throw new Error("Sticky destination peer does not match the source route.");
|
|
926
|
-
// The fee
|
|
927
|
-
// retryables refund later on L2, where the
|
|
927
|
+
// The fee payer can return only same-call refunds. Native Arbitrum L1
|
|
928
|
+
// retryables refund later on L2, where the fee payer cannot attribute or return
|
|
928
929
|
// that caller's payment. This is a qualification mitigation, not a contract
|
|
929
930
|
// restriction or a fix to the upstream asynchronous refund destination.
|
|
930
931
|
const transport = await classifySuckerTransport(sourceClient, sucker);
|