@whetstone-research/doppler-sdk 0.0.17 → 0.0.19
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/README.md +66 -1
- package/dist/DopplerSDK.js +19 -19
- package/dist/DopplerSDK.mjs +18 -18
- package/dist/abis/index.d.mts +32 -1
- package/dist/abis/index.d.ts +32 -1
- package/dist/abis/index.js +26 -22
- package/dist/abis/index.mjs +1 -1
- package/dist/addresses.d.mts +1 -0
- package/dist/addresses.d.ts +1 -0
- package/dist/addresses.js +7 -7
- package/dist/addresses.mjs +2 -2
- package/dist/builders/DynamicAuctionBuilder.js +10 -10
- package/dist/builders/DynamicAuctionBuilder.mjs +9 -9
- package/dist/builders/MulticurveBuilder.d.mts +16 -0
- package/dist/builders/MulticurveBuilder.d.ts +16 -0
- package/dist/builders/MulticurveBuilder.js +10 -10
- package/dist/builders/MulticurveBuilder.mjs +9 -9
- package/dist/builders/StaticAuctionBuilder.js +10 -10
- package/dist/builders/StaticAuctionBuilder.mjs +9 -9
- package/dist/builders/index.js +18 -18
- package/dist/builders/index.mjs +11 -11
- package/dist/builders/shared.js +11 -11
- package/dist/builders/shared.mjs +7 -7
- package/dist/{chunk-LOVD3NCN.js → chunk-3MVW6UIW.js} +18 -2
- package/dist/chunk-3MVW6UIW.js.map +1 -0
- package/dist/{chunk-DVAQB7TB.mjs → chunk-3NFSMMBF.mjs} +3 -3
- package/dist/{chunk-DVAQB7TB.mjs.map → chunk-3NFSMMBF.mjs.map} +1 -1
- package/dist/{chunk-PBWOCVDZ.mjs → chunk-4TAAZ6W3.mjs} +248 -51
- package/dist/chunk-4TAAZ6W3.mjs.map +1 -0
- package/dist/{chunk-4DUE547M.js → chunk-6BQY5EPB.js} +4 -2
- package/dist/chunk-6BQY5EPB.js.map +1 -0
- package/dist/{chunk-HVM7KZJM.mjs → chunk-6HFZ6XMV.mjs} +4 -4
- package/dist/{chunk-HVM7KZJM.mjs.map → chunk-6HFZ6XMV.mjs.map} +1 -1
- package/dist/{chunk-EG6O2TUX.js → chunk-7Z2UGWE7.js} +26 -26
- package/dist/{chunk-EG6O2TUX.js.map → chunk-7Z2UGWE7.js.map} +1 -1
- package/dist/{chunk-O2DZH23A.mjs → chunk-CYY5IATT.mjs} +9 -5
- package/dist/chunk-CYY5IATT.mjs.map +1 -0
- package/dist/{chunk-BZKX3J3R.mjs → chunk-E2NF4AQB.mjs} +18 -3
- package/dist/chunk-E2NF4AQB.mjs.map +1 -0
- package/dist/{chunk-B4B7BXLI.js → chunk-E6ACC5S6.js} +24 -24
- package/dist/{chunk-B4B7BXLI.js.map → chunk-E6ACC5S6.js.map} +1 -1
- package/dist/{chunk-K5CV3MIH.mjs → chunk-FQ3PVXZU.mjs} +5 -5
- package/dist/{chunk-K5CV3MIH.mjs.map → chunk-FQ3PVXZU.mjs.map} +1 -1
- package/dist/{chunk-WQKBQRBS.mjs → chunk-GCT3IZ3E.mjs} +12 -12
- package/dist/{chunk-WQKBQRBS.mjs.map → chunk-GCT3IZ3E.mjs.map} +1 -1
- package/dist/{chunk-LDZCTC5Q.mjs → chunk-H5SUGQ2C.mjs} +45 -7
- package/dist/chunk-H5SUGQ2C.mjs.map +1 -0
- package/dist/{chunk-PE47QUJV.mjs → chunk-HH7HQ4HC.mjs} +3 -3
- package/dist/{chunk-PE47QUJV.mjs.map → chunk-HH7HQ4HC.mjs.map} +1 -1
- package/dist/{chunk-LXUF7RNX.mjs → chunk-IWJOPXYN.mjs} +4 -3
- package/dist/chunk-IWJOPXYN.mjs.map +1 -0
- package/dist/{chunk-MBOKYN2Y.js → chunk-K3TEDYUG.js} +20 -20
- package/dist/{chunk-MBOKYN2Y.js.map → chunk-K3TEDYUG.js.map} +1 -1
- package/dist/{chunk-NVVEUALG.mjs → chunk-MH74WYVZ.mjs} +5 -5
- package/dist/{chunk-NVVEUALG.mjs.map → chunk-MH74WYVZ.mjs.map} +1 -1
- package/dist/{chunk-ZVH7VBH5.mjs → chunk-N74ICDSX.mjs} +118 -20
- package/dist/chunk-N74ICDSX.mjs.map +1 -0
- package/dist/{chunk-C7GN6GPG.js → chunk-OROTK4OT.js} +51 -27
- package/dist/chunk-OROTK4OT.js.map +1 -0
- package/dist/{chunk-Z7ZGPSQF.js → chunk-P4BT5GDO.js} +76 -72
- package/dist/chunk-P4BT5GDO.js.map +1 -0
- package/dist/{chunk-YBDWQTUH.mjs → chunk-QFQXHDC7.mjs} +76 -9
- package/dist/chunk-QFQXHDC7.mjs.map +1 -0
- package/dist/{chunk-RKJ2466C.mjs → chunk-QOGBOT2M.mjs} +3 -3
- package/dist/{chunk-RKJ2466C.mjs.map → chunk-QOGBOT2M.mjs.map} +1 -1
- package/dist/{chunk-3ALNQHGL.js → chunk-RLUMYHPI.js} +76 -9
- package/dist/chunk-RLUMYHPI.js.map +1 -0
- package/dist/{chunk-5FJCRKQ6.js → chunk-RXUJ4DUB.js} +28 -28
- package/dist/{chunk-5FJCRKQ6.js.map → chunk-RXUJ4DUB.js.map} +1 -1
- package/dist/{chunk-MGLI4N4B.js → chunk-SAX7P3MH.js} +22 -22
- package/dist/{chunk-MGLI4N4B.js.map → chunk-SAX7P3MH.js.map} +1 -1
- package/dist/{chunk-3ORKVXQL.js → chunk-TJCMFITE.js} +27 -27
- package/dist/{chunk-3ORKVXQL.js.map → chunk-TJCMFITE.js.map} +1 -1
- package/dist/{chunk-TL7U67CX.js → chunk-UIPSHVT4.js} +11 -11
- package/dist/{chunk-TL7U67CX.js.map → chunk-UIPSHVT4.js.map} +1 -1
- package/dist/{chunk-5ZPBKSNS.mjs → chunk-UY4TVYEU.mjs} +3 -3
- package/dist/{chunk-5ZPBKSNS.mjs.map → chunk-UY4TVYEU.mjs.map} +1 -1
- package/dist/{chunk-PQUS2LCD.js → chunk-UZTVXZP3.js} +16 -16
- package/dist/{chunk-PQUS2LCD.js.map → chunk-UZTVXZP3.js.map} +1 -1
- package/dist/{chunk-HMZEYBFO.mjs → chunk-V32Q2S3U.mjs} +4 -4
- package/dist/{chunk-HMZEYBFO.mjs.map → chunk-V32Q2S3U.mjs.map} +1 -1
- package/dist/{chunk-7F4O7NPS.js → chunk-V5GPJ6S2.js} +26 -26
- package/dist/{chunk-7F4O7NPS.js.map → chunk-V5GPJ6S2.js.map} +1 -1
- package/dist/{chunk-DOWDXOTK.mjs → chunk-VGCXJRUV.mjs} +51 -27
- package/dist/chunk-VGCXJRUV.mjs.map +1 -0
- package/dist/{chunk-J32XSN44.js → chunk-WYRM5BAI.js} +344 -147
- package/dist/chunk-WYRM5BAI.js.map +1 -0
- package/dist/{chunk-OUUFER2X.mjs → chunk-X7FRTHUL.mjs} +4 -4
- package/dist/{chunk-OUUFER2X.mjs.map → chunk-X7FRTHUL.mjs.map} +1 -1
- package/dist/{chunk-E54BP2GN.js → chunk-Y6VZD4C6.js} +53 -15
- package/dist/chunk-Y6VZD4C6.js.map +1 -0
- package/dist/{chunk-5MP6AMPB.js → chunk-YFJUIO2A.js} +132 -34
- package/dist/chunk-YFJUIO2A.js.map +1 -0
- package/dist/{chunk-WHQHXYPB.js → chunk-YKRDFXU3.js} +5 -5
- package/dist/{chunk-WHQHXYPB.js.map → chunk-YKRDFXU3.js.map} +1 -1
- package/dist/constants.d.mts +7 -1
- package/dist/constants.d.ts +7 -1
- package/dist/constants.js +51 -47
- package/dist/constants.mjs +1 -1
- package/dist/deployments.generated.d.mts +72 -5
- package/dist/deployments.generated.d.ts +72 -5
- package/dist/deployments.generated.js +2 -2
- package/dist/deployments.generated.mjs +1 -1
- package/dist/entities/DopplerFactory.d.mts +2 -0
- package/dist/entities/DopplerFactory.d.ts +2 -0
- package/dist/entities/DopplerFactory.js +8 -8
- package/dist/entities/DopplerFactory.mjs +7 -7
- package/dist/entities/auction/DynamicAuction.js +5 -5
- package/dist/entities/auction/DynamicAuction.mjs +4 -4
- package/dist/entities/auction/MulticurvePool.d.mts +9 -3
- package/dist/entities/auction/MulticurvePool.d.ts +9 -3
- package/dist/entities/auction/MulticurvePool.js +7 -6
- package/dist/entities/auction/MulticurvePool.mjs +6 -5
- package/dist/entities/auction/StaticAuction.js +5 -5
- package/dist/entities/auction/StaticAuction.mjs +4 -4
- package/dist/entities/auction/index.js +11 -10
- package/dist/entities/auction/index.mjs +8 -7
- package/dist/entities/quoter/Quoter.js +5 -5
- package/dist/entities/quoter/Quoter.mjs +4 -4
- package/dist/entities/quoter/index.js +5 -5
- package/dist/entities/quoter/index.mjs +4 -4
- package/dist/entities/token/derc20/Derc20.js +3 -3
- package/dist/entities/token/derc20/Derc20.mjs +2 -2
- package/dist/entities/token/derc20/index.js +3 -3
- package/dist/entities/token/derc20/index.mjs +2 -2
- package/dist/entities/token/index.js +3 -3
- package/dist/entities/token/index.mjs +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +110 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -18
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +32 -1
- package/dist/types.d.ts +32 -1
- package/dist/types.js +8 -8
- package/dist/types.mjs +3 -3
- package/dist/utils/airlock.js +7 -7
- package/dist/utils/airlock.mjs +3 -3
- package/dist/utils/index.js +10 -10
- package/dist/utils/index.mjs +5 -5
- package/dist/utils/tokenAddressMiner.d.mts +7 -0
- package/dist/utils/tokenAddressMiner.d.ts +7 -0
- package/dist/utils/tokenAddressMiner.js +3 -3
- package/dist/utils/tokenAddressMiner.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-3ALNQHGL.js.map +0 -1
- package/dist/chunk-4DUE547M.js.map +0 -1
- package/dist/chunk-5MP6AMPB.js.map +0 -1
- package/dist/chunk-BZKX3J3R.mjs.map +0 -1
- package/dist/chunk-C7GN6GPG.js.map +0 -1
- package/dist/chunk-DOWDXOTK.mjs.map +0 -1
- package/dist/chunk-E54BP2GN.js.map +0 -1
- package/dist/chunk-J32XSN44.js.map +0 -1
- package/dist/chunk-LDZCTC5Q.mjs.map +0 -1
- package/dist/chunk-LOVD3NCN.js.map +0 -1
- package/dist/chunk-LXUF7RNX.mjs.map +0 -1
- package/dist/chunk-O2DZH23A.mjs.map +0 -1
- package/dist/chunk-PBWOCVDZ.mjs.map +0 -1
- package/dist/chunk-YBDWQTUH.mjs.map +0 -1
- package/dist/chunk-Z7ZGPSQF.js.map +0 -1
- package/dist/chunk-ZVH7VBH5.mjs.map +0 -1
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var chunkUPVKABAV_js = require('./chunk-UPVKABAV.js');
|
|
4
4
|
var chunk6H6X3VTZ_js = require('./chunk-6H6X3VTZ.js');
|
|
5
5
|
var chunk4VWQNNNW_js = require('./chunk-4VWQNNNW.js');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
var chunk6BQY5EPB_js = require('./chunk-6BQY5EPB.js');
|
|
7
|
+
var chunkP4BT5GDO_js = require('./chunk-P4BT5GDO.js');
|
|
8
|
+
var chunk3MVW6UIW_js = require('./chunk-3MVW6UIW.js');
|
|
9
9
|
var chunkOF7BIKXV_js = require('./chunk-OF7BIKXV.js');
|
|
10
10
|
var chunk2ZM4JVFC_js = require('./chunk-2ZM4JVFC.js');
|
|
11
11
|
var chunkSMTHFPBA_js = require('./chunk-SMTHFPBA.js');
|
|
@@ -32,7 +32,7 @@ var DopplerFactory = class {
|
|
|
32
32
|
}
|
|
33
33
|
async encodeCreateStaticAuctionParams(params) {
|
|
34
34
|
this.validateStaticAuctionParams(params);
|
|
35
|
-
const addresses =
|
|
35
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
36
36
|
const hasBeneficiaries = params.pool.beneficiaries && params.pool.beneficiaries.length > 0;
|
|
37
37
|
let poolInitializerData;
|
|
38
38
|
if (hasBeneficiaries) {
|
|
@@ -67,8 +67,8 @@ var DopplerFactory = class {
|
|
|
67
67
|
fee: params.pool.fee,
|
|
68
68
|
tickLower: params.pool.startTick,
|
|
69
69
|
tickUpper: params.pool.endTick,
|
|
70
|
-
numPositions: params.pool.numPositions ??
|
|
71
|
-
maxShareToBeSold: params.pool.maxShareToBeSold ??
|
|
70
|
+
numPositions: params.pool.numPositions ?? chunk6BQY5EPB_js.DEFAULT_V3_NUM_POSITIONS,
|
|
71
|
+
maxShareToBeSold: params.pool.maxShareToBeSold ?? chunk6BQY5EPB_js.DEFAULT_V3_MAX_SHARE_TO_BE_SOLD,
|
|
72
72
|
beneficiaries: sortedBeneficiaries.map((b) => ({
|
|
73
73
|
beneficiary: b.beneficiary,
|
|
74
74
|
shares: b.shares
|
|
@@ -95,8 +95,8 @@ var DopplerFactory = class {
|
|
|
95
95
|
fee: params.pool.fee,
|
|
96
96
|
tickLower: params.pool.startTick,
|
|
97
97
|
tickUpper: params.pool.endTick,
|
|
98
|
-
numPositions: params.pool.numPositions ??
|
|
99
|
-
maxShareToBeSold: params.pool.maxShareToBeSold ??
|
|
98
|
+
numPositions: params.pool.numPositions ?? chunk6BQY5EPB_js.DEFAULT_V3_NUM_POSITIONS,
|
|
99
|
+
maxShareToBeSold: params.pool.maxShareToBeSold ?? chunk6BQY5EPB_js.DEFAULT_V3_MAX_SHARE_TO_BE_SOLD
|
|
100
100
|
}
|
|
101
101
|
]
|
|
102
102
|
);
|
|
@@ -119,7 +119,7 @@ var DopplerFactory = class {
|
|
|
119
119
|
} else {
|
|
120
120
|
const tokenStd = params.token;
|
|
121
121
|
const vestingDuration = params.vesting?.duration ?? BigInt(0);
|
|
122
|
-
const yearlyMintRate = tokenStd.yearlyMintRate ??
|
|
122
|
+
const yearlyMintRate = tokenStd.yearlyMintRate ?? chunk6BQY5EPB_js.DEFAULT_V4_YEARLY_MINT_RATE;
|
|
123
123
|
let vestingRecipients = [];
|
|
124
124
|
let vestingAmounts = [];
|
|
125
125
|
if (params.vesting) {
|
|
@@ -173,16 +173,16 @@ var DopplerFactory = class {
|
|
|
173
173
|
],
|
|
174
174
|
[
|
|
175
175
|
params.token.name,
|
|
176
|
-
params.governance.type === "custom" ? params.governance.initialVotingDelay :
|
|
177
|
-
params.governance.type === "custom" ? params.governance.initialVotingPeriod :
|
|
178
|
-
params.governance.type === "custom" ? params.governance.initialProposalThreshold :
|
|
176
|
+
params.governance.type === "custom" ? params.governance.initialVotingDelay : chunk6BQY5EPB_js.DEFAULT_V3_INITIAL_VOTING_DELAY,
|
|
177
|
+
params.governance.type === "custom" ? params.governance.initialVotingPeriod : chunk6BQY5EPB_js.DEFAULT_V3_INITIAL_VOTING_PERIOD,
|
|
178
|
+
params.governance.type === "custom" ? params.governance.initialProposalThreshold : chunk6BQY5EPB_js.DEFAULT_V3_INITIAL_PROPOSAL_THRESHOLD
|
|
179
179
|
]
|
|
180
180
|
);
|
|
181
181
|
})();
|
|
182
182
|
const governanceFactoryAddress = (() => {
|
|
183
183
|
if (params.governance.type === "noOp") {
|
|
184
|
-
const resolved2 = params.modules?.governanceFactory ?? addresses.noOpGovernanceFactory ??
|
|
185
|
-
if (!resolved2 || resolved2 ===
|
|
184
|
+
const resolved2 = params.modules?.governanceFactory ?? addresses.noOpGovernanceFactory ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
185
|
+
if (!resolved2 || resolved2 === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
186
186
|
throw new Error(
|
|
187
187
|
"No-op governance requested, but no-op governanceFactory is not configured on this chain. Provide a governanceFactory override or use a supported chain."
|
|
188
188
|
);
|
|
@@ -190,8 +190,8 @@ var DopplerFactory = class {
|
|
|
190
190
|
return resolved2;
|
|
191
191
|
}
|
|
192
192
|
if (params.governance.type === "launchpad") {
|
|
193
|
-
const resolved2 = params.modules?.governanceFactory ?? addresses.launchpadGovernanceFactory ??
|
|
194
|
-
if (!resolved2 || resolved2 ===
|
|
193
|
+
const resolved2 = params.modules?.governanceFactory ?? addresses.launchpadGovernanceFactory ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
194
|
+
if (!resolved2 || resolved2 === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
195
195
|
throw new Error(
|
|
196
196
|
"Launchpad governance requested, but launchpadGovernanceFactory is not configured on this chain. Provide a governanceFactory override or use a supported chain."
|
|
197
197
|
);
|
|
@@ -199,7 +199,7 @@ var DopplerFactory = class {
|
|
|
199
199
|
return resolved2;
|
|
200
200
|
}
|
|
201
201
|
const resolved = params.modules?.governanceFactory ?? addresses.governanceFactory;
|
|
202
|
-
if (!resolved || resolved ===
|
|
202
|
+
if (!resolved || resolved === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
203
203
|
throw new Error(
|
|
204
204
|
"Standard governance requested but governanceFactory is not deployed on this chain."
|
|
205
205
|
);
|
|
@@ -207,7 +207,7 @@ var DopplerFactory = class {
|
|
|
207
207
|
return resolved;
|
|
208
208
|
})();
|
|
209
209
|
const resolvedTokenFactory = params.modules?.tokenFactory ?? (this.isDoppler404Token(params.token) ? addresses.doppler404Factory : addresses.tokenFactory);
|
|
210
|
-
if (!resolvedTokenFactory || resolvedTokenFactory ===
|
|
210
|
+
if (!resolvedTokenFactory || resolvedTokenFactory === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
211
211
|
throw new Error(
|
|
212
212
|
"Token factory address not configured. Provide an explicit address via builder.withTokenFactory(...) or ensure chain config includes a valid factory."
|
|
213
213
|
);
|
|
@@ -238,7 +238,7 @@ var DopplerFactory = class {
|
|
|
238
238
|
params.modules
|
|
239
239
|
),
|
|
240
240
|
liquidityMigratorData,
|
|
241
|
-
integrator: params.integrator ??
|
|
241
|
+
integrator: params.integrator ?? chunk6BQY5EPB_js.ZERO_ADDRESS
|
|
242
242
|
};
|
|
243
243
|
const minedCreateParams = await this.mineTokenOrder({
|
|
244
244
|
params,
|
|
@@ -253,11 +253,11 @@ var DopplerFactory = class {
|
|
|
253
253
|
*/
|
|
254
254
|
async simulateCreateStaticAuction(params) {
|
|
255
255
|
const createParams = await this.encodeCreateStaticAuctionParams(params);
|
|
256
|
-
const addresses =
|
|
256
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
257
257
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
258
258
|
const { request, result } = await this.publicClient.simulateContract({
|
|
259
259
|
address: airlockAddress,
|
|
260
|
-
abi:
|
|
260
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
261
261
|
functionName: "create",
|
|
262
262
|
args: [{ ...createParams }],
|
|
263
263
|
account: this.walletClient?.account
|
|
@@ -287,14 +287,14 @@ var DopplerFactory = class {
|
|
|
287
287
|
*/
|
|
288
288
|
async createStaticAuction(params, options) {
|
|
289
289
|
const createParams = options?._createParams ?? (await this.simulateCreateStaticAuction(params)).createParams;
|
|
290
|
-
const addresses =
|
|
290
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
291
291
|
if (!this.walletClient) {
|
|
292
292
|
throw new Error("Wallet client required for write operations");
|
|
293
293
|
}
|
|
294
294
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
295
295
|
const { request, result } = await this.publicClient.simulateContract({
|
|
296
296
|
address: airlockAddress,
|
|
297
|
-
abi:
|
|
297
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
298
298
|
functionName: "create",
|
|
299
299
|
args: [{ ...createParams }],
|
|
300
300
|
account: this.walletClient.account
|
|
@@ -306,7 +306,7 @@ var DopplerFactory = class {
|
|
|
306
306
|
createParams,
|
|
307
307
|
account: this.walletClient.account
|
|
308
308
|
});
|
|
309
|
-
const gasOverride = params.gas ?? gasEstimate ??
|
|
309
|
+
const gasOverride = params.gas ?? gasEstimate ?? chunk6BQY5EPB_js.DEFAULT_CREATE_GAS_LIMIT;
|
|
310
310
|
const hash = await this.walletClient.writeContract({
|
|
311
311
|
...request,
|
|
312
312
|
gas: gasOverride
|
|
@@ -381,7 +381,7 @@ var DopplerFactory = class {
|
|
|
381
381
|
const createEvent = receipt.logs.find((log) => {
|
|
382
382
|
try {
|
|
383
383
|
const decoded2 = viem.decodeEventLog({
|
|
384
|
-
abi:
|
|
384
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
385
385
|
data: log.data,
|
|
386
386
|
topics: log.topics
|
|
387
387
|
});
|
|
@@ -392,7 +392,7 @@ var DopplerFactory = class {
|
|
|
392
392
|
});
|
|
393
393
|
if (!createEvent) return null;
|
|
394
394
|
const decoded = viem.decodeEventLog({
|
|
395
|
-
abi:
|
|
395
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
396
396
|
data: createEvent.data,
|
|
397
397
|
topics: createEvent.topics
|
|
398
398
|
});
|
|
@@ -409,7 +409,7 @@ var DopplerFactory = class {
|
|
|
409
409
|
async mineTokenOrder(args) {
|
|
410
410
|
const { params, baseCreateParams, addresses } = args;
|
|
411
411
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
412
|
-
if (!airlockAddress || airlockAddress ===
|
|
412
|
+
if (!airlockAddress || airlockAddress === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
413
413
|
throw new Error(
|
|
414
414
|
"Airlock address not configured. Provide an explicit address via modules.airlock or ensure chain config includes a valid airlock."
|
|
415
415
|
);
|
|
@@ -423,7 +423,7 @@ var DopplerFactory = class {
|
|
|
423
423
|
const createParams = { ...baseCreateParams, salt };
|
|
424
424
|
const { result } = await this.publicClient.simulateContract({
|
|
425
425
|
address: airlockAddress,
|
|
426
|
-
abi:
|
|
426
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
427
427
|
functionName: "create",
|
|
428
428
|
args: [{ ...createParams }],
|
|
429
429
|
account: accountForSimulation
|
|
@@ -450,7 +450,7 @@ var DopplerFactory = class {
|
|
|
450
450
|
}
|
|
451
451
|
async encodeCreateDynamicAuctionParams(params) {
|
|
452
452
|
this.validateDynamicAuctionParams(params);
|
|
453
|
-
const addresses =
|
|
453
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
454
454
|
const gamma = params.auction.gamma ?? chunkUPVKABAV_js.computeOptimalGamma(
|
|
455
455
|
params.auction.startTick,
|
|
456
456
|
params.auction.endTick,
|
|
@@ -483,12 +483,12 @@ var DopplerFactory = class {
|
|
|
483
483
|
gamma,
|
|
484
484
|
isToken0: false,
|
|
485
485
|
// Will be determined during mining
|
|
486
|
-
numPDSlugs: BigInt(params.auction.numPdSlugs ??
|
|
486
|
+
numPDSlugs: BigInt(params.auction.numPdSlugs ?? chunk6BQY5EPB_js.DEFAULT_PD_SLUGS),
|
|
487
487
|
fee: params.pool.fee,
|
|
488
488
|
tickSpacing: params.pool.tickSpacing
|
|
489
489
|
};
|
|
490
490
|
if (this.isDoppler404Token(params.token)) {
|
|
491
|
-
if (!addresses.doppler404Factory || addresses.doppler404Factory ===
|
|
491
|
+
if (!addresses.doppler404Factory || addresses.doppler404Factory === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
492
492
|
throw new Error(
|
|
493
493
|
"Doppler404 factory address not configured for this chain"
|
|
494
494
|
);
|
|
@@ -523,7 +523,7 @@ var DopplerFactory = class {
|
|
|
523
523
|
symbol: t.symbol,
|
|
524
524
|
initialSupply: params.sale.initialSupply,
|
|
525
525
|
airlock: addresses.airlock,
|
|
526
|
-
yearlyMintRate: t.yearlyMintRate ??
|
|
526
|
+
yearlyMintRate: t.yearlyMintRate ?? chunk6BQY5EPB_js.DEFAULT_V4_YEARLY_MINT_RATE,
|
|
527
527
|
vestingDuration: BigInt(vestingDuration),
|
|
528
528
|
recipients: vestingRecipients,
|
|
529
529
|
amounts: vestingAmounts,
|
|
@@ -531,7 +531,7 @@ var DopplerFactory = class {
|
|
|
531
531
|
};
|
|
532
532
|
})();
|
|
533
533
|
const resolvedTokenFactoryDyn = params.modules?.tokenFactory ?? (this.isDoppler404Token(params.token) ? addresses.doppler404Factory : addresses.tokenFactory);
|
|
534
|
-
if (!resolvedTokenFactoryDyn || resolvedTokenFactoryDyn ===
|
|
534
|
+
if (!resolvedTokenFactoryDyn || resolvedTokenFactoryDyn === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
535
535
|
throw new Error(
|
|
536
536
|
"Token factory address not configured. Provide an explicit address via builder.withTokenFactory(...) or ensure chain config includes a valid factory."
|
|
537
537
|
);
|
|
@@ -575,16 +575,16 @@ var DopplerFactory = class {
|
|
|
575
575
|
],
|
|
576
576
|
[
|
|
577
577
|
params.token.name,
|
|
578
|
-
params.governance.type === "custom" ? params.governance.initialVotingDelay :
|
|
579
|
-
params.governance.type === "custom" ? params.governance.initialVotingPeriod :
|
|
580
|
-
params.governance.type === "custom" ? params.governance.initialProposalThreshold :
|
|
578
|
+
params.governance.type === "custom" ? params.governance.initialVotingDelay : chunk6BQY5EPB_js.DEFAULT_V4_INITIAL_VOTING_DELAY,
|
|
579
|
+
params.governance.type === "custom" ? params.governance.initialVotingPeriod : chunk6BQY5EPB_js.DEFAULT_V4_INITIAL_VOTING_PERIOD,
|
|
580
|
+
params.governance.type === "custom" ? params.governance.initialProposalThreshold : chunk6BQY5EPB_js.DEFAULT_V4_INITIAL_PROPOSAL_THRESHOLD
|
|
581
581
|
]
|
|
582
582
|
);
|
|
583
583
|
})();
|
|
584
584
|
const governanceFactoryAddress = (() => {
|
|
585
585
|
if (params.governance.type === "noOp") {
|
|
586
|
-
const resolved2 = params.modules?.governanceFactory ?? addresses.noOpGovernanceFactory ??
|
|
587
|
-
if (!resolved2 || resolved2 ===
|
|
586
|
+
const resolved2 = params.modules?.governanceFactory ?? addresses.noOpGovernanceFactory ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
587
|
+
if (!resolved2 || resolved2 === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
588
588
|
throw new Error(
|
|
589
589
|
"No-op governance requested, but no-op governanceFactory is not configured on this chain. Provide a governanceFactory override or use a supported chain."
|
|
590
590
|
);
|
|
@@ -592,8 +592,8 @@ var DopplerFactory = class {
|
|
|
592
592
|
return resolved2;
|
|
593
593
|
}
|
|
594
594
|
if (params.governance.type === "launchpad") {
|
|
595
|
-
const resolved2 = params.modules?.governanceFactory ?? addresses.launchpadGovernanceFactory ??
|
|
596
|
-
if (!resolved2 || resolved2 ===
|
|
595
|
+
const resolved2 = params.modules?.governanceFactory ?? addresses.launchpadGovernanceFactory ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
596
|
+
if (!resolved2 || resolved2 === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
597
597
|
throw new Error(
|
|
598
598
|
"Launchpad governance requested, but launchpadGovernanceFactory is not configured on this chain. Provide a governanceFactory override or use a supported chain."
|
|
599
599
|
);
|
|
@@ -601,7 +601,7 @@ var DopplerFactory = class {
|
|
|
601
601
|
return resolved2;
|
|
602
602
|
}
|
|
603
603
|
const resolved = params.modules?.governanceFactory ?? addresses.governanceFactory;
|
|
604
|
-
if (!resolved || resolved ===
|
|
604
|
+
if (!resolved || resolved === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
605
605
|
throw new Error(
|
|
606
606
|
"Standard governance requested but governanceFactory is not deployed on this chain."
|
|
607
607
|
);
|
|
@@ -623,7 +623,7 @@ var DopplerFactory = class {
|
|
|
623
623
|
params.modules
|
|
624
624
|
),
|
|
625
625
|
liquidityMigratorData,
|
|
626
|
-
integrator: params.integrator ??
|
|
626
|
+
integrator: params.integrator ?? chunk6BQY5EPB_js.ZERO_ADDRESS,
|
|
627
627
|
salt
|
|
628
628
|
};
|
|
629
629
|
return { createParams, hookAddress, tokenAddress };
|
|
@@ -634,7 +634,7 @@ var DopplerFactory = class {
|
|
|
634
634
|
* @returns The address of the created hook and token
|
|
635
635
|
*/
|
|
636
636
|
async createDynamicAuction(params, options) {
|
|
637
|
-
const addresses =
|
|
637
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
638
638
|
let createParams;
|
|
639
639
|
if (options?._createParams) {
|
|
640
640
|
createParams = options._createParams;
|
|
@@ -648,7 +648,7 @@ var DopplerFactory = class {
|
|
|
648
648
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
649
649
|
const { request, result } = await this.publicClient.simulateContract({
|
|
650
650
|
address: airlockAddress,
|
|
651
|
-
abi:
|
|
651
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
652
652
|
functionName: "create",
|
|
653
653
|
args: [{ ...createParams }],
|
|
654
654
|
account: this.walletClient.account
|
|
@@ -660,7 +660,7 @@ var DopplerFactory = class {
|
|
|
660
660
|
createParams,
|
|
661
661
|
account: this.walletClient.account
|
|
662
662
|
});
|
|
663
|
-
const gasOverride = params.gas ?? gasEstimate ??
|
|
663
|
+
const gasOverride = params.gas ?? gasEstimate ?? chunk6BQY5EPB_js.DEFAULT_CREATE_GAS_LIMIT;
|
|
664
664
|
const hash = await this.walletClient.writeContract({
|
|
665
665
|
...request,
|
|
666
666
|
gas: gasOverride
|
|
@@ -708,11 +708,11 @@ var DopplerFactory = class {
|
|
|
708
708
|
*/
|
|
709
709
|
async simulateCreateDynamicAuction(params) {
|
|
710
710
|
const { createParams } = await this.encodeCreateDynamicAuctionParams(params);
|
|
711
|
-
const addresses =
|
|
711
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
712
712
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
713
713
|
const { request, result } = await this.publicClient.simulateContract({
|
|
714
714
|
address: airlockAddress,
|
|
715
|
-
abi:
|
|
715
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
716
716
|
functionName: "create",
|
|
717
717
|
args: [{ ...createParams }],
|
|
718
718
|
account: this.walletClient?.account
|
|
@@ -754,7 +754,7 @@ var DopplerFactory = class {
|
|
|
754
754
|
try {
|
|
755
755
|
const estimated = await this.publicClient.estimateContractGas({
|
|
756
756
|
address,
|
|
757
|
-
abi:
|
|
757
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
758
758
|
functionName: "create",
|
|
759
759
|
args: [{ ...createParams }],
|
|
760
760
|
account
|
|
@@ -822,6 +822,163 @@ var DopplerFactory = class {
|
|
|
822
822
|
/**
|
|
823
823
|
* Encode create params for Uniswap V4 Multicurve initializer/migrator flow
|
|
824
824
|
*/
|
|
825
|
+
normalizeUint32(value, label) {
|
|
826
|
+
const normalized = typeof value === "bigint" ? Number(value) : Number(value);
|
|
827
|
+
if (!Number.isFinite(normalized) || !Number.isInteger(normalized)) {
|
|
828
|
+
throw new Error(
|
|
829
|
+
`${label} must be an integer number of seconds since Unix epoch`
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
if (normalized < 0) {
|
|
833
|
+
throw new Error(`${label} cannot be negative`);
|
|
834
|
+
}
|
|
835
|
+
const UINT32_MAX = 4294967295;
|
|
836
|
+
if (normalized > UINT32_MAX) {
|
|
837
|
+
throw new Error(
|
|
838
|
+
`${label} must fit within uint32 (seconds since Unix epoch up to year 2106)`
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
return normalized;
|
|
842
|
+
}
|
|
843
|
+
resolveMulticurveInitializerMode(params) {
|
|
844
|
+
const legacySchedule = params.schedule;
|
|
845
|
+
const legacyHook = params.dopplerHook;
|
|
846
|
+
const hasLegacySchedule = legacySchedule !== void 0;
|
|
847
|
+
const hasLegacyHook = legacyHook !== void 0;
|
|
848
|
+
if (hasLegacySchedule && hasLegacyHook) {
|
|
849
|
+
throw new Error(
|
|
850
|
+
"Cannot combine schedule and dopplerHook legacy multicurve options. Use exactly one initializer mode."
|
|
851
|
+
);
|
|
852
|
+
}
|
|
853
|
+
const initializer = params.initializer;
|
|
854
|
+
let mode;
|
|
855
|
+
if (!initializer) {
|
|
856
|
+
if (hasLegacySchedule) {
|
|
857
|
+
mode = {
|
|
858
|
+
type: "scheduled",
|
|
859
|
+
startTime: this.normalizeUint32(
|
|
860
|
+
legacySchedule.startTime,
|
|
861
|
+
"Scheduled multicurve startTime"
|
|
862
|
+
)
|
|
863
|
+
};
|
|
864
|
+
} else if (hasLegacyHook) {
|
|
865
|
+
mode = {
|
|
866
|
+
type: "rehype",
|
|
867
|
+
hookConfig: legacyHook
|
|
868
|
+
};
|
|
869
|
+
} else {
|
|
870
|
+
mode = { type: "standard" };
|
|
871
|
+
}
|
|
872
|
+
} else {
|
|
873
|
+
switch (initializer.type) {
|
|
874
|
+
case "standard": {
|
|
875
|
+
if (hasLegacySchedule || hasLegacyHook) {
|
|
876
|
+
throw new Error(
|
|
877
|
+
"Initializer type 'standard' cannot be combined with legacy schedule/dopplerHook fields"
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
mode = { type: "standard" };
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
case "scheduled": {
|
|
884
|
+
if (hasLegacyHook) {
|
|
885
|
+
throw new Error(
|
|
886
|
+
"Initializer type 'scheduled' cannot be combined with dopplerHook"
|
|
887
|
+
);
|
|
888
|
+
}
|
|
889
|
+
const normalizedStart = this.normalizeUint32(
|
|
890
|
+
initializer.startTime,
|
|
891
|
+
"Scheduled multicurve startTime"
|
|
892
|
+
);
|
|
893
|
+
if (hasLegacySchedule) {
|
|
894
|
+
const legacyStart = this.normalizeUint32(
|
|
895
|
+
legacySchedule.startTime,
|
|
896
|
+
"Scheduled multicurve startTime"
|
|
897
|
+
);
|
|
898
|
+
if (legacyStart !== normalizedStart) {
|
|
899
|
+
throw new Error(
|
|
900
|
+
"Conflicting scheduled start times provided via initializer and schedule"
|
|
901
|
+
);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
mode = { type: "scheduled", startTime: normalizedStart };
|
|
905
|
+
break;
|
|
906
|
+
}
|
|
907
|
+
case "decay": {
|
|
908
|
+
if (hasLegacySchedule || hasLegacyHook) {
|
|
909
|
+
throw new Error(
|
|
910
|
+
"Initializer type 'decay' cannot be combined with legacy schedule/dopplerHook fields"
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
const startTime = this.normalizeUint32(
|
|
914
|
+
initializer.startTime,
|
|
915
|
+
"Decay multicurve startTime"
|
|
916
|
+
);
|
|
917
|
+
const startFee = Number(initializer.startFee);
|
|
918
|
+
const durationSeconds = this.normalizeUint32(
|
|
919
|
+
initializer.durationSeconds,
|
|
920
|
+
"Decay multicurve durationSeconds"
|
|
921
|
+
);
|
|
922
|
+
const endFee = Number(params.pool.fee);
|
|
923
|
+
if (!Number.isInteger(startFee)) {
|
|
924
|
+
throw new Error("Decay multicurve startFee must be an integer");
|
|
925
|
+
}
|
|
926
|
+
if (startFee < 0 || startFee > chunk6BQY5EPB_js.DECAY_MAX_START_FEE) {
|
|
927
|
+
throw new Error(
|
|
928
|
+
`Decay multicurve startFee must be between 0 and ${chunk6BQY5EPB_js.DECAY_MAX_START_FEE}`
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
if (!Number.isInteger(endFee) || endFee < 0 || endFee > chunk6BQY5EPB_js.V4_MAX_FEE) {
|
|
932
|
+
throw new Error(
|
|
933
|
+
`Multicurve pool fee must be between 0 and ${chunk6BQY5EPB_js.V4_MAX_FEE}`
|
|
934
|
+
);
|
|
935
|
+
}
|
|
936
|
+
if (startFee < endFee) {
|
|
937
|
+
throw new Error(
|
|
938
|
+
`Decay multicurve startFee (${startFee}) must be greater than or equal to terminal pool fee (${endFee})`
|
|
939
|
+
);
|
|
940
|
+
}
|
|
941
|
+
if (startFee > endFee && durationSeconds <= 0) {
|
|
942
|
+
throw new Error(
|
|
943
|
+
"Decay multicurve durationSeconds must be greater than 0 when startFee is greater than terminal pool fee"
|
|
944
|
+
);
|
|
945
|
+
}
|
|
946
|
+
mode = {
|
|
947
|
+
type: "decay",
|
|
948
|
+
startTime,
|
|
949
|
+
startFee,
|
|
950
|
+
durationSeconds
|
|
951
|
+
};
|
|
952
|
+
break;
|
|
953
|
+
}
|
|
954
|
+
case "rehype": {
|
|
955
|
+
if (hasLegacySchedule) {
|
|
956
|
+
throw new Error(
|
|
957
|
+
"Initializer type 'rehype' cannot be combined with schedule"
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
mode = { type: "rehype", hookConfig: initializer.config };
|
|
961
|
+
break;
|
|
962
|
+
}
|
|
963
|
+
default: {
|
|
964
|
+
const exhaustive = initializer;
|
|
965
|
+
throw new Error(
|
|
966
|
+
`Unsupported multicurve initializer type: ${exhaustive?.type ?? "unknown"}`
|
|
967
|
+
);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
if (params.modules?.dopplerHookInitializer !== void 0) {
|
|
972
|
+
if (mode.type === "standard") {
|
|
973
|
+
mode = { type: "rehype" };
|
|
974
|
+
} else if (mode.type !== "rehype") {
|
|
975
|
+
throw new Error(
|
|
976
|
+
"modules.dopplerHookInitializer can only be used with the rehype or standard multicurve initializer mode"
|
|
977
|
+
);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return mode;
|
|
981
|
+
}
|
|
825
982
|
encodeCreateMulticurveParams(params) {
|
|
826
983
|
this.validateMulticurveParams(params);
|
|
827
984
|
if (!params.pool || params.pool.curves.length === 0) {
|
|
@@ -831,7 +988,7 @@ var DopplerFactory = class {
|
|
|
831
988
|
params.pool.curves,
|
|
832
989
|
params.pool.tickSpacing
|
|
833
990
|
);
|
|
834
|
-
const addresses =
|
|
991
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
835
992
|
const sortedBeneficiaries = (params.pool.beneficiaries ?? []).slice().sort(
|
|
836
993
|
(a, b) => {
|
|
837
994
|
const aAddr = a.beneficiary.toLowerCase();
|
|
@@ -839,33 +996,16 @@ var DopplerFactory = class {
|
|
|
839
996
|
return aAddr < bAddr ? -1 : aAddr > bAddr ? 1 : 0;
|
|
840
997
|
}
|
|
841
998
|
);
|
|
842
|
-
const
|
|
843
|
-
const
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
if (
|
|
847
|
-
|
|
848
|
-
if (!Number.isFinite(scheduleStartTime) || !Number.isInteger(scheduleStartTime)) {
|
|
849
|
-
throw new Error(
|
|
850
|
-
"Scheduled multicurve startTime must be an integer number of seconds since Unix epoch"
|
|
851
|
-
);
|
|
852
|
-
}
|
|
853
|
-
if (scheduleStartTime < 0) {
|
|
854
|
-
throw new Error("Scheduled multicurve startTime cannot be negative");
|
|
855
|
-
}
|
|
856
|
-
const UINT32_MAX = 4294967295;
|
|
857
|
-
if (scheduleStartTime > UINT32_MAX) {
|
|
858
|
-
throw new Error(
|
|
859
|
-
"Scheduled multicurve startTime must fit within uint32 (seconds since Unix epoch up to year 2106)"
|
|
860
|
-
);
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
if (useDopplerHook) {
|
|
864
|
-
const hook = params.dopplerHook;
|
|
999
|
+
const initializerMode = this.resolveMulticurveInitializerMode(params);
|
|
1000
|
+
const useScheduledInitializer = initializerMode.type === "scheduled";
|
|
1001
|
+
const useDecayInitializer = initializerMode.type === "decay";
|
|
1002
|
+
const useDopplerHookInitializer = initializerMode.type === "rehype";
|
|
1003
|
+
if (initializerMode.type === "rehype" && initializerMode.hookConfig) {
|
|
1004
|
+
const hook = initializerMode.hookConfig;
|
|
865
1005
|
const totalDistribution = hook.assetBuybackPercentWad + hook.numeraireBuybackPercentWad + hook.beneficiaryPercentWad + hook.lpPercentWad;
|
|
866
|
-
if (totalDistribution !==
|
|
1006
|
+
if (totalDistribution !== chunk6BQY5EPB_js.WAD) {
|
|
867
1007
|
throw new Error(
|
|
868
|
-
`DopplerHook fee distribution must sum to ${
|
|
1008
|
+
`DopplerHook fee distribution must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${totalDistribution}`
|
|
869
1009
|
);
|
|
870
1010
|
}
|
|
871
1011
|
}
|
|
@@ -895,19 +1035,19 @@ var DopplerFactory = class {
|
|
|
895
1035
|
);
|
|
896
1036
|
let poolInitializerData;
|
|
897
1037
|
if (useDopplerHookInitializer) {
|
|
1038
|
+
const hookConfig = initializerMode.type === "rehype" ? initializerMode.hookConfig : void 0;
|
|
898
1039
|
let farTick;
|
|
899
|
-
if (
|
|
900
|
-
farTick =
|
|
1040
|
+
if (hookConfig?.farTick !== void 0) {
|
|
1041
|
+
farTick = hookConfig.farTick;
|
|
901
1042
|
} else {
|
|
902
1043
|
const allTickUppers = params.pool.curves.map((c) => c.tickUpper);
|
|
903
1044
|
farTick = Math.max(...allTickUppers);
|
|
904
1045
|
}
|
|
905
1046
|
let onInitializationDopplerHookCalldata = "0x";
|
|
906
1047
|
let graduationDopplerHookCalldata = "0x";
|
|
907
|
-
let dopplerHookAddress =
|
|
908
|
-
if (
|
|
909
|
-
|
|
910
|
-
dopplerHookAddress = hook.hookAddress;
|
|
1048
|
+
let dopplerHookAddress = chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
1049
|
+
if (hookConfig) {
|
|
1050
|
+
dopplerHookAddress = hookConfig.hookAddress;
|
|
911
1051
|
onInitializationDopplerHookCalldata = viem.encodeAbiParameters(
|
|
912
1052
|
[
|
|
913
1053
|
{ type: "address" },
|
|
@@ -927,15 +1067,15 @@ var DopplerFactory = class {
|
|
|
927
1067
|
],
|
|
928
1068
|
[
|
|
929
1069
|
params.sale.numeraire,
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
1070
|
+
hookConfig.buybackDestination,
|
|
1071
|
+
hookConfig.customFee,
|
|
1072
|
+
hookConfig.assetBuybackPercentWad,
|
|
1073
|
+
hookConfig.numeraireBuybackPercentWad,
|
|
1074
|
+
hookConfig.beneficiaryPercentWad,
|
|
1075
|
+
hookConfig.lpPercentWad
|
|
936
1076
|
]
|
|
937
1077
|
);
|
|
938
|
-
graduationDopplerHookCalldata =
|
|
1078
|
+
graduationDopplerHookCalldata = hookConfig.graduationCalldata ?? "0x";
|
|
939
1079
|
}
|
|
940
1080
|
const dopplerHookTupleComponents = [
|
|
941
1081
|
{ name: "fee", type: "uint24" },
|
|
@@ -966,7 +1106,43 @@ var DopplerFactory = class {
|
|
|
966
1106
|
}
|
|
967
1107
|
]
|
|
968
1108
|
);
|
|
1109
|
+
} else if (useDecayInitializer) {
|
|
1110
|
+
const decayTupleComponents = [
|
|
1111
|
+
{ name: "startFee", type: "uint24" },
|
|
1112
|
+
{ name: "fee", type: "uint24" },
|
|
1113
|
+
{ name: "durationSeconds", type: "uint32" },
|
|
1114
|
+
{ name: "tickSpacing", type: "int24" },
|
|
1115
|
+
{ name: "curves", type: "tuple[]", components: curveComponents },
|
|
1116
|
+
{
|
|
1117
|
+
name: "beneficiaries",
|
|
1118
|
+
type: "tuple[]",
|
|
1119
|
+
components: beneficiaryComponents
|
|
1120
|
+
},
|
|
1121
|
+
{ name: "startingTime", type: "uint32" }
|
|
1122
|
+
];
|
|
1123
|
+
if (initializerMode.type !== "decay") {
|
|
1124
|
+
throw new Error("Invalid multicurve initializer state for decay mode");
|
|
1125
|
+
}
|
|
1126
|
+
poolInitializerData = viem.encodeAbiParameters(
|
|
1127
|
+
[{ type: "tuple", components: decayTupleComponents }],
|
|
1128
|
+
[
|
|
1129
|
+
{
|
|
1130
|
+
startFee: initializerMode.startFee,
|
|
1131
|
+
fee: params.pool.fee,
|
|
1132
|
+
durationSeconds: initializerMode.durationSeconds,
|
|
1133
|
+
tickSpacing: params.pool.tickSpacing,
|
|
1134
|
+
curves: curvesData,
|
|
1135
|
+
beneficiaries: beneficiariesData,
|
|
1136
|
+
startingTime: initializerMode.startTime
|
|
1137
|
+
}
|
|
1138
|
+
]
|
|
1139
|
+
);
|
|
969
1140
|
} else if (useScheduledInitializer) {
|
|
1141
|
+
if (initializerMode.type !== "scheduled") {
|
|
1142
|
+
throw new Error(
|
|
1143
|
+
"Invalid multicurve initializer state for scheduled mode"
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
970
1146
|
const scheduledTupleComponents = [
|
|
971
1147
|
{ name: "fee", type: "uint24" },
|
|
972
1148
|
{ name: "tickSpacing", type: "int24" },
|
|
@@ -986,7 +1162,7 @@ var DopplerFactory = class {
|
|
|
986
1162
|
tickSpacing: params.pool.tickSpacing,
|
|
987
1163
|
curves: curvesData,
|
|
988
1164
|
beneficiaries: beneficiariesData,
|
|
989
|
-
startingTime:
|
|
1165
|
+
startingTime: initializerMode.startTime
|
|
990
1166
|
}
|
|
991
1167
|
]
|
|
992
1168
|
);
|
|
@@ -1029,7 +1205,7 @@ var DopplerFactory = class {
|
|
|
1029
1205
|
} else {
|
|
1030
1206
|
const tokenStd = params.token;
|
|
1031
1207
|
const vestingDuration = params.vesting?.duration ?? BigInt(0);
|
|
1032
|
-
const yearlyMintRate = tokenStd.yearlyMintRate ??
|
|
1208
|
+
const yearlyMintRate = tokenStd.yearlyMintRate ?? chunk6BQY5EPB_js.DEFAULT_V3_YEARLY_MINT_RATE;
|
|
1033
1209
|
let vestingRecipients = [];
|
|
1034
1210
|
let vestingAmounts = [];
|
|
1035
1211
|
if (params.vesting) {
|
|
@@ -1083,15 +1259,15 @@ var DopplerFactory = class {
|
|
|
1083
1259
|
],
|
|
1084
1260
|
[
|
|
1085
1261
|
params.token.name,
|
|
1086
|
-
params.governance.type === "custom" ? params.governance.initialVotingDelay :
|
|
1087
|
-
params.governance.type === "custom" ? params.governance.initialVotingPeriod :
|
|
1088
|
-
params.governance.type === "custom" ? params.governance.initialProposalThreshold :
|
|
1262
|
+
params.governance.type === "custom" ? params.governance.initialVotingDelay : chunk6BQY5EPB_js.DEFAULT_V4_INITIAL_VOTING_DELAY,
|
|
1263
|
+
params.governance.type === "custom" ? params.governance.initialVotingPeriod : chunk6BQY5EPB_js.DEFAULT_V4_INITIAL_VOTING_PERIOD,
|
|
1264
|
+
params.governance.type === "custom" ? params.governance.initialProposalThreshold : chunk6BQY5EPB_js.DEFAULT_V4_INITIAL_PROPOSAL_THRESHOLD
|
|
1089
1265
|
]
|
|
1090
1266
|
);
|
|
1091
1267
|
})();
|
|
1092
1268
|
const salt = this.generateRandomSalt(params.userAddress);
|
|
1093
1269
|
const resolvedTokenFactory = params.modules?.tokenFactory ?? (this.isDoppler404Token(params.token) ? addresses.doppler404Factory : addresses.tokenFactory);
|
|
1094
|
-
if (!resolvedTokenFactory || resolvedTokenFactory ===
|
|
1270
|
+
if (!resolvedTokenFactory || resolvedTokenFactory === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
1095
1271
|
throw new Error(
|
|
1096
1272
|
"Token factory address not configured. Provide an explicit address or ensure chain config includes a valid factory."
|
|
1097
1273
|
);
|
|
@@ -1100,17 +1276,25 @@ var DopplerFactory = class {
|
|
|
1100
1276
|
if (useDopplerHookInitializer) {
|
|
1101
1277
|
return params.modules?.dopplerHookInitializer ?? addresses.dopplerHookInitializer;
|
|
1102
1278
|
}
|
|
1279
|
+
if (useDecayInitializer) {
|
|
1280
|
+
return params.modules?.v4DecayMulticurveInitializer ?? addresses.v4DecayMulticurveInitializer;
|
|
1281
|
+
}
|
|
1103
1282
|
if (useScheduledInitializer) {
|
|
1104
1283
|
return params.modules?.v4ScheduledMulticurveInitializer ?? addresses.v4ScheduledMulticurveInitializer;
|
|
1105
1284
|
}
|
|
1106
1285
|
return params.modules?.v4MulticurveInitializer ?? addresses.v4MulticurveInitializer;
|
|
1107
1286
|
})();
|
|
1108
|
-
if (!resolvedInitializer || resolvedInitializer ===
|
|
1287
|
+
if (!resolvedInitializer || resolvedInitializer === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
1109
1288
|
if (useDopplerHookInitializer) {
|
|
1110
1289
|
throw new Error(
|
|
1111
1290
|
"DopplerHookInitializer address not configured on this chain. Override via builder.withDopplerHookInitializer() or update chain config."
|
|
1112
1291
|
);
|
|
1113
1292
|
}
|
|
1293
|
+
if (useDecayInitializer) {
|
|
1294
|
+
throw new Error(
|
|
1295
|
+
"Decay multicurve initializer address not configured on this chain. Override via builder.withV4DecayMulticurveInitializer() or update chain config."
|
|
1296
|
+
);
|
|
1297
|
+
}
|
|
1114
1298
|
throw new Error(
|
|
1115
1299
|
useScheduledInitializer ? "Scheduled multicurve initializer address not configured on this chain. Override via builder or update chain config." : "Multicurve initializer address not configured on this chain. Override via builder or update chain config."
|
|
1116
1300
|
);
|
|
@@ -1121,7 +1305,7 @@ var DopplerFactory = class {
|
|
|
1121
1305
|
if (hasBeneficiaries) {
|
|
1122
1306
|
liquidityMigratorData = "0x";
|
|
1123
1307
|
resolvedMigrator = params.modules?.noOpMigrator ?? addresses.noOpMigrator;
|
|
1124
|
-
if (!resolvedMigrator || resolvedMigrator ===
|
|
1308
|
+
if (!resolvedMigrator || resolvedMigrator === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
1125
1309
|
throw new Error(
|
|
1126
1310
|
"NoOpMigrator address not configured on this chain. Override via modules.noOpMigrator or update chain config."
|
|
1127
1311
|
);
|
|
@@ -1132,7 +1316,7 @@ var DopplerFactory = class {
|
|
|
1132
1316
|
params.migration,
|
|
1133
1317
|
params.modules
|
|
1134
1318
|
);
|
|
1135
|
-
if (!resolvedMigrator || resolvedMigrator ===
|
|
1319
|
+
if (!resolvedMigrator || resolvedMigrator === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
1136
1320
|
throw new Error(
|
|
1137
1321
|
"Migrator address not configured on this chain. Override via builder or update chain config."
|
|
1138
1322
|
);
|
|
@@ -1140,8 +1324,8 @@ var DopplerFactory = class {
|
|
|
1140
1324
|
}
|
|
1141
1325
|
const governanceFactoryAddress = (() => {
|
|
1142
1326
|
if (params.governance.type === "noOp") {
|
|
1143
|
-
const resolved2 = params.modules?.governanceFactory ?? addresses.noOpGovernanceFactory ??
|
|
1144
|
-
if (!resolved2 || resolved2 ===
|
|
1327
|
+
const resolved2 = params.modules?.governanceFactory ?? addresses.noOpGovernanceFactory ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
1328
|
+
if (!resolved2 || resolved2 === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
1145
1329
|
throw new Error(
|
|
1146
1330
|
"No-op governance requested, but no-op governanceFactory is not configured on this chain."
|
|
1147
1331
|
);
|
|
@@ -1149,8 +1333,8 @@ var DopplerFactory = class {
|
|
|
1149
1333
|
return resolved2;
|
|
1150
1334
|
}
|
|
1151
1335
|
if (params.governance.type === "launchpad") {
|
|
1152
|
-
const resolved2 = params.modules?.governanceFactory ?? addresses.launchpadGovernanceFactory ??
|
|
1153
|
-
if (!resolved2 || resolved2 ===
|
|
1336
|
+
const resolved2 = params.modules?.governanceFactory ?? addresses.launchpadGovernanceFactory ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
1337
|
+
if (!resolved2 || resolved2 === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
1154
1338
|
throw new Error(
|
|
1155
1339
|
"Launchpad governance requested, but launchpadGovernanceFactory is not configured on this chain."
|
|
1156
1340
|
);
|
|
@@ -1158,7 +1342,7 @@ var DopplerFactory = class {
|
|
|
1158
1342
|
return resolved2;
|
|
1159
1343
|
}
|
|
1160
1344
|
const resolved = params.modules?.governanceFactory ?? addresses.governanceFactory;
|
|
1161
|
-
if (!resolved || resolved ===
|
|
1345
|
+
if (!resolved || resolved === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
1162
1346
|
throw new Error(
|
|
1163
1347
|
"Standard governance requested but governanceFactory is not deployed on this chain."
|
|
1164
1348
|
);
|
|
@@ -1177,18 +1361,18 @@ var DopplerFactory = class {
|
|
|
1177
1361
|
poolInitializerData,
|
|
1178
1362
|
liquidityMigrator: resolvedMigrator,
|
|
1179
1363
|
liquidityMigratorData,
|
|
1180
|
-
integrator: params.integrator ??
|
|
1364
|
+
integrator: params.integrator ?? chunk6BQY5EPB_js.ZERO_ADDRESS,
|
|
1181
1365
|
salt
|
|
1182
1366
|
};
|
|
1183
1367
|
return createParams;
|
|
1184
1368
|
}
|
|
1185
1369
|
async simulateCreateMulticurve(params) {
|
|
1186
|
-
const addresses =
|
|
1370
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
1187
1371
|
const createParams = this.encodeCreateMulticurveParams(params);
|
|
1188
1372
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
1189
1373
|
const { request, result } = await this.publicClient.simulateContract({
|
|
1190
1374
|
address: airlockAddress,
|
|
1191
|
-
abi:
|
|
1375
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
1192
1376
|
functionName: "create",
|
|
1193
1377
|
args: [{ ...createParams }],
|
|
1194
1378
|
account: this.walletClient?.account
|
|
@@ -1214,14 +1398,14 @@ var DopplerFactory = class {
|
|
|
1214
1398
|
};
|
|
1215
1399
|
}
|
|
1216
1400
|
async createMulticurve(params, options) {
|
|
1217
|
-
const addresses =
|
|
1401
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
1218
1402
|
if (!this.walletClient)
|
|
1219
1403
|
throw new Error("Wallet client required for write operations");
|
|
1220
1404
|
const createParams = options?._createParams ?? (await this.simulateCreateMulticurve(params)).createParams;
|
|
1221
1405
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
1222
1406
|
const { request, result } = await this.publicClient.simulateContract({
|
|
1223
1407
|
address: airlockAddress,
|
|
1224
|
-
abi:
|
|
1408
|
+
abi: chunk3MVW6UIW_js.airlockAbi,
|
|
1225
1409
|
functionName: "create",
|
|
1226
1410
|
args: [{ ...createParams }],
|
|
1227
1411
|
account: this.walletClient.account
|
|
@@ -1233,7 +1417,7 @@ var DopplerFactory = class {
|
|
|
1233
1417
|
createParams,
|
|
1234
1418
|
account: this.walletClient.account
|
|
1235
1419
|
});
|
|
1236
|
-
const gas = params.gas ?? gasEstimate ??
|
|
1420
|
+
const gas = params.gas ?? gasEstimate ?? chunk6BQY5EPB_js.DEFAULT_CREATE_GAS_LIMIT;
|
|
1237
1421
|
const hash = await this.walletClient.writeContract({ ...request, gas });
|
|
1238
1422
|
const receipt = await this.publicClient.waitForTransactionReceipt({ hash, confirmations: 2 });
|
|
1239
1423
|
const actualAddresses = this.extractAddressesFromCreateEvent(receipt);
|
|
@@ -1288,7 +1472,7 @@ var DopplerFactory = class {
|
|
|
1288
1472
|
throw new Error("Multicurve curve shares must be positive");
|
|
1289
1473
|
}
|
|
1290
1474
|
totalShares += sanitized.shares;
|
|
1291
|
-
if (totalShares >
|
|
1475
|
+
if (totalShares > chunk6BQY5EPB_js.WAD) {
|
|
1292
1476
|
throw new Error("Total multicurve shares cannot exceed 100% (1e18)");
|
|
1293
1477
|
}
|
|
1294
1478
|
if (mostPositiveTickUpper === void 0 || sanitized.tickUpper > mostPositiveTickUpper) {
|
|
@@ -1296,10 +1480,10 @@ var DopplerFactory = class {
|
|
|
1296
1480
|
}
|
|
1297
1481
|
return sanitized;
|
|
1298
1482
|
});
|
|
1299
|
-
if (totalShares ===
|
|
1483
|
+
if (totalShares === chunk6BQY5EPB_js.WAD) {
|
|
1300
1484
|
return sanitizedCurves;
|
|
1301
1485
|
}
|
|
1302
|
-
const missingShare =
|
|
1486
|
+
const missingShare = chunk6BQY5EPB_js.WAD - totalShares;
|
|
1303
1487
|
if (missingShare <= 0n) {
|
|
1304
1488
|
return sanitizedCurves;
|
|
1305
1489
|
}
|
|
@@ -1334,7 +1518,7 @@ var DopplerFactory = class {
|
|
|
1334
1518
|
if (params.pool.startTick >= params.pool.endTick) {
|
|
1335
1519
|
throw new Error("Start tick must be less than end tick");
|
|
1336
1520
|
}
|
|
1337
|
-
const tickSpacing =
|
|
1521
|
+
const tickSpacing = chunk6BQY5EPB_js.TICK_SPACINGS[params.pool.fee];
|
|
1338
1522
|
if (tickSpacing === void 0) {
|
|
1339
1523
|
throw new Error(
|
|
1340
1524
|
`Unsupported fee tier ${params.pool.fee} for static auctions`
|
|
@@ -1396,18 +1580,18 @@ var DopplerFactory = class {
|
|
|
1396
1580
|
);
|
|
1397
1581
|
}
|
|
1398
1582
|
const totalShares = beneficiaries.reduce((sum, b) => sum + b.shares, 0n);
|
|
1399
|
-
if (totalShares !==
|
|
1583
|
+
if (totalShares !== chunk6BQY5EPB_js.WAD) {
|
|
1400
1584
|
throw new Error(
|
|
1401
|
-
`Beneficiary shares must sum to ${
|
|
1585
|
+
`Beneficiary shares must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${totalShares}`
|
|
1402
1586
|
);
|
|
1403
1587
|
}
|
|
1404
1588
|
}
|
|
1405
1589
|
if (params.pool.beneficiaries && params.pool.beneficiaries.length > 0) {
|
|
1406
1590
|
const beneficiaries = params.pool.beneficiaries;
|
|
1407
1591
|
const totalShares = beneficiaries.reduce((sum, b) => sum + b.shares, 0n);
|
|
1408
|
-
if (totalShares !==
|
|
1592
|
+
if (totalShares !== chunk6BQY5EPB_js.WAD) {
|
|
1409
1593
|
throw new Error(
|
|
1410
|
-
`Pool beneficiary shares must sum to ${
|
|
1594
|
+
`Pool beneficiary shares must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${totalShares}`
|
|
1411
1595
|
);
|
|
1412
1596
|
}
|
|
1413
1597
|
for (const b of beneficiaries) {
|
|
@@ -1456,9 +1640,9 @@ var DopplerFactory = class {
|
|
|
1456
1640
|
if (params.pool.tickSpacing <= 0) {
|
|
1457
1641
|
throw new Error("Tick spacing must be positive");
|
|
1458
1642
|
}
|
|
1459
|
-
if (params.pool.tickSpacing >
|
|
1643
|
+
if (params.pool.tickSpacing > chunk6BQY5EPB_js.DOPPLER_MAX_TICK_SPACING) {
|
|
1460
1644
|
throw new Error(
|
|
1461
|
-
`Dynamic auctions require tickSpacing <= ${
|
|
1645
|
+
`Dynamic auctions require tickSpacing <= ${chunk6BQY5EPB_js.DOPPLER_MAX_TICK_SPACING} (Doppler.sol MAX_TICK_SPACING). Got tickSpacing=${params.pool.tickSpacing}. Use withMarketCapRange() which handles this automatically, or use a smaller tickSpacing with poolConfig().`
|
|
1462
1646
|
);
|
|
1463
1647
|
}
|
|
1464
1648
|
if (params.auction.duration % params.auction.epochLength !== 0) {
|
|
@@ -1477,9 +1661,9 @@ var DopplerFactory = class {
|
|
|
1477
1661
|
);
|
|
1478
1662
|
}
|
|
1479
1663
|
const totalShares = beneficiaries.reduce((sum, b) => sum + b.shares, 0n);
|
|
1480
|
-
if (totalShares !==
|
|
1664
|
+
if (totalShares !== chunk6BQY5EPB_js.WAD) {
|
|
1481
1665
|
throw new Error(
|
|
1482
|
-
`Beneficiary shares must sum to ${
|
|
1666
|
+
`Beneficiary shares must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${totalShares}`
|
|
1483
1667
|
);
|
|
1484
1668
|
}
|
|
1485
1669
|
}
|
|
@@ -1503,6 +1687,7 @@ var DopplerFactory = class {
|
|
|
1503
1687
|
if (params.sale.numTokensToSell > params.sale.initialSupply) {
|
|
1504
1688
|
throw new Error("Cannot sell more tokens than initial supply");
|
|
1505
1689
|
}
|
|
1690
|
+
this.resolveMulticurveInitializerMode(params);
|
|
1506
1691
|
if (params.vesting) {
|
|
1507
1692
|
if (params.vesting.recipients && params.vesting.amounts) {
|
|
1508
1693
|
if (params.vesting.recipients.length !== params.vesting.amounts.length) {
|
|
@@ -1528,9 +1713,9 @@ var DopplerFactory = class {
|
|
|
1528
1713
|
if (params.pool.beneficiaries && params.pool.beneficiaries.length > 0) {
|
|
1529
1714
|
const beneficiaries = params.pool.beneficiaries;
|
|
1530
1715
|
const totalShares = beneficiaries.reduce((sum, b) => sum + b.shares, 0n);
|
|
1531
|
-
if (totalShares !==
|
|
1716
|
+
if (totalShares !== chunk6BQY5EPB_js.WAD) {
|
|
1532
1717
|
throw new Error(
|
|
1533
|
-
`Pool beneficiary shares must sum to ${
|
|
1718
|
+
`Pool beneficiary shares must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${totalShares}`
|
|
1534
1719
|
);
|
|
1535
1720
|
}
|
|
1536
1721
|
for (const b of beneficiaries) {
|
|
@@ -1547,9 +1732,9 @@ var DopplerFactory = class {
|
|
|
1547
1732
|
);
|
|
1548
1733
|
}
|
|
1549
1734
|
const totalShares = beneficiaries.reduce((sum, b) => sum + b.shares, 0n);
|
|
1550
|
-
if (totalShares !==
|
|
1735
|
+
if (totalShares !== chunk6BQY5EPB_js.WAD) {
|
|
1551
1736
|
throw new Error(
|
|
1552
|
-
`Beneficiary shares must sum to ${
|
|
1737
|
+
`Beneficiary shares must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${totalShares}`
|
|
1553
1738
|
);
|
|
1554
1739
|
}
|
|
1555
1740
|
}
|
|
@@ -1558,14 +1743,14 @@ var DopplerFactory = class {
|
|
|
1558
1743
|
* Get the airlock contract address for the current chain
|
|
1559
1744
|
*/
|
|
1560
1745
|
getAirlockAddress() {
|
|
1561
|
-
const addresses =
|
|
1746
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
1562
1747
|
return addresses.airlock;
|
|
1563
1748
|
}
|
|
1564
1749
|
/**
|
|
1565
1750
|
* Get the appropriate initializer address based on auction type
|
|
1566
1751
|
*/
|
|
1567
1752
|
getInitializerAddress(isStatic) {
|
|
1568
|
-
const addresses =
|
|
1753
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
1569
1754
|
return isStatic ? addresses.v3Initializer : addresses.v4Initializer;
|
|
1570
1755
|
}
|
|
1571
1756
|
/**
|
|
@@ -1573,7 +1758,7 @@ var DopplerFactory = class {
|
|
|
1573
1758
|
* Used to perform atomic create + swap ("bundle") flows for static auctions
|
|
1574
1759
|
*/
|
|
1575
1760
|
getBundlerAddress() {
|
|
1576
|
-
const addresses =
|
|
1761
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
1577
1762
|
const addr = addresses.bundler;
|
|
1578
1763
|
if (!addr || addr === viem.zeroAddress) {
|
|
1579
1764
|
throw new Error("Bundler address not configured for this chain");
|
|
@@ -1585,7 +1770,7 @@ var DopplerFactory = class {
|
|
|
1585
1770
|
* Allows override via ModuleAddressOverrides when provided in params.
|
|
1586
1771
|
*/
|
|
1587
1772
|
getMigratorAddress(config, overrides) {
|
|
1588
|
-
const addresses =
|
|
1773
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
1589
1774
|
switch (config.type) {
|
|
1590
1775
|
case "uniswapV2":
|
|
1591
1776
|
return overrides?.v2Migrator ?? addresses.v2Migrator;
|
|
@@ -1624,7 +1809,7 @@ var DopplerFactory = class {
|
|
|
1624
1809
|
const bundler = this.getBundlerAddress();
|
|
1625
1810
|
const { result } = await this.publicClient.simulateContract({
|
|
1626
1811
|
address: bundler,
|
|
1627
|
-
abi:
|
|
1812
|
+
abi: chunk3MVW6UIW_js.bundlerAbi,
|
|
1628
1813
|
functionName: "simulateBundleExactIn",
|
|
1629
1814
|
args: [
|
|
1630
1815
|
{ ...createParams },
|
|
@@ -1647,7 +1832,7 @@ var DopplerFactory = class {
|
|
|
1647
1832
|
const bundler = this.getBundlerAddress();
|
|
1648
1833
|
const { result } = await this.publicClient.simulateContract({
|
|
1649
1834
|
address: bundler,
|
|
1650
|
-
abi:
|
|
1835
|
+
abi: chunk3MVW6UIW_js.bundlerAbi,
|
|
1651
1836
|
functionName: "simulateBundleExactOut",
|
|
1652
1837
|
args: [
|
|
1653
1838
|
{ ...createParams },
|
|
@@ -1671,7 +1856,7 @@ var DopplerFactory = class {
|
|
|
1671
1856
|
const hookData = "0x";
|
|
1672
1857
|
const { result } = await this.publicClient.simulateContract({
|
|
1673
1858
|
address: bundler,
|
|
1674
|
-
abi:
|
|
1859
|
+
abi: chunk3MVW6UIW_js.bundlerAbi,
|
|
1675
1860
|
functionName: "simulateMulticurveBundleExactOut",
|
|
1676
1861
|
args: [{ ...createParams }, exactAmountOut, hookData]
|
|
1677
1862
|
});
|
|
@@ -1696,7 +1881,7 @@ var DopplerFactory = class {
|
|
|
1696
1881
|
const hookData = "0x";
|
|
1697
1882
|
const { result } = await this.publicClient.simulateContract({
|
|
1698
1883
|
address: bundler,
|
|
1699
|
-
abi:
|
|
1884
|
+
abi: chunk3MVW6UIW_js.bundlerAbi,
|
|
1700
1885
|
functionName: "simulateMulticurveBundleExactIn",
|
|
1701
1886
|
args: [{ ...createParams }, exactAmountIn, hookData]
|
|
1702
1887
|
});
|
|
@@ -1719,7 +1904,7 @@ var DopplerFactory = class {
|
|
|
1719
1904
|
const bundler = this.getBundlerAddress();
|
|
1720
1905
|
const { request } = await this.publicClient.simulateContract({
|
|
1721
1906
|
address: bundler,
|
|
1722
|
-
abi:
|
|
1907
|
+
abi: chunk3MVW6UIW_js.bundlerAbi,
|
|
1723
1908
|
functionName: "bundle",
|
|
1724
1909
|
args: [{ ...createParams }, commands, inputs],
|
|
1725
1910
|
account: this.walletClient.account,
|
|
@@ -2035,7 +2220,7 @@ var DopplerFactory = class {
|
|
|
2035
2220
|
this.updateSaltInBuffer(hookBuffer, salt);
|
|
2036
2221
|
const hookRaw = this.computeCreate2AddressFast(hookBuffer);
|
|
2037
2222
|
const hookBigInt = BigInt(hookRaw);
|
|
2038
|
-
if ((hookBigInt &
|
|
2223
|
+
if ((hookBigInt & chunk6BQY5EPB_js.FLAG_MASK) !== flags) {
|
|
2039
2224
|
continue;
|
|
2040
2225
|
}
|
|
2041
2226
|
if (tokenBuffer) {
|
|
@@ -2156,26 +2341,38 @@ var DopplerFactory = class {
|
|
|
2156
2341
|
* Compute the V4 poolId for a multicurve pool by reading the hook address from the initializer
|
|
2157
2342
|
*/
|
|
2158
2343
|
async computeMulticurvePoolId(params, tokenAddress) {
|
|
2159
|
-
const addresses =
|
|
2160
|
-
const
|
|
2161
|
-
|
|
2162
|
-
if (
|
|
2163
|
-
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
|
-
|
|
2344
|
+
const addresses = chunkP4BT5GDO_js.getAddresses(this.chainId);
|
|
2345
|
+
const initializerMode = this.resolveMulticurveInitializerMode(params);
|
|
2346
|
+
let hookAddress;
|
|
2347
|
+
if (initializerMode.type === "rehype") {
|
|
2348
|
+
hookAddress = initializerMode.hookConfig?.hookAddress ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
2349
|
+
} else {
|
|
2350
|
+
const initializerAddress = (() => {
|
|
2351
|
+
if (initializerMode.type === "decay") {
|
|
2352
|
+
return params.modules?.v4DecayMulticurveInitializer ?? addresses.v4DecayMulticurveInitializer;
|
|
2353
|
+
}
|
|
2354
|
+
if (initializerMode.type === "scheduled") {
|
|
2355
|
+
return params.modules?.v4ScheduledMulticurveInitializer ?? addresses.v4ScheduledMulticurveInitializer;
|
|
2356
|
+
}
|
|
2357
|
+
return params.modules?.v4MulticurveInitializer ?? addresses.v4MulticurveInitializer;
|
|
2358
|
+
})();
|
|
2359
|
+
if (!initializerAddress) {
|
|
2360
|
+
throw new Error("Multicurve initializer address not configured");
|
|
2361
|
+
}
|
|
2362
|
+
hookAddress = await this.publicClient.readContract({
|
|
2167
2363
|
address: initializerAddress,
|
|
2168
|
-
abi:
|
|
2364
|
+
abi: chunk3MVW6UIW_js.v4MulticurveInitializerAbi,
|
|
2169
2365
|
functionName: "HOOK"
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2366
|
+
});
|
|
2367
|
+
}
|
|
2172
2368
|
const numeraire = params.sale.numeraire;
|
|
2173
2369
|
const currency0 = tokenAddress < numeraire ? tokenAddress : numeraire;
|
|
2174
2370
|
const currency1 = tokenAddress < numeraire ? numeraire : tokenAddress;
|
|
2371
|
+
const fee = initializerMode.type === "decay" ? chunk6BQY5EPB_js.DYNAMIC_FEE_FLAG : params.pool.fee;
|
|
2175
2372
|
return this.computePoolId({
|
|
2176
2373
|
currency0,
|
|
2177
2374
|
currency1,
|
|
2178
|
-
fee
|
|
2375
|
+
fee,
|
|
2179
2376
|
tickSpacing: params.pool.tickSpacing,
|
|
2180
2377
|
hooks: hookAddress
|
|
2181
2378
|
});
|
|
@@ -2206,5 +2403,5 @@ var DopplerFactory = class {
|
|
|
2206
2403
|
var MULTICURVE_BUNDLER_SELECTORS = ["0xe2e9faa1", "0x07087b06"];
|
|
2207
2404
|
|
|
2208
2405
|
exports.DopplerFactory = DopplerFactory;
|
|
2209
|
-
//# sourceMappingURL=chunk-
|
|
2210
|
-
//# sourceMappingURL=chunk-
|
|
2406
|
+
//# sourceMappingURL=chunk-WYRM5BAI.js.map
|
|
2407
|
+
//# sourceMappingURL=chunk-WYRM5BAI.js.map
|