@whetstone-research/doppler-sdk 0.0.22 → 0.0.24
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 +553 -221
- package/dist/DopplerSDK.d.mts +12 -0
- package/dist/DopplerSDK.d.ts +12 -0
- package/dist/DopplerSDK.js +29 -26
- package/dist/DopplerSDK.mjs +28 -25
- package/dist/abis/bytecodes/derc20.js +2 -2
- package/dist/abis/bytecodes/derc20.mjs +1 -1
- package/dist/abis/bytecodes/derc2080.js +2 -2
- package/dist/abis/bytecodes/derc2080.mjs +1 -1
- package/dist/abis/bytecodes/doppler.js +2 -2
- package/dist/abis/bytecodes/doppler.mjs +1 -1
- package/dist/abis/bytecodes/dopplerDN404.js +2 -2
- package/dist/abis/bytecodes/dopplerDN404.mjs +1 -1
- package/dist/abis/bytecodes/stateView.js +2 -2
- package/dist/abis/bytecodes/stateView.mjs +1 -1
- package/dist/abis/bytecodes.js +10 -10
- package/dist/abis/bytecodes.mjs +5 -5
- package/dist/abis/index.d.mts +421 -10
- package/dist/abis/index.d.ts +421 -10
- package/dist/abis/index.js +41 -33
- package/dist/abis/index.mjs +6 -6
- package/dist/addresses.d.mts +6 -0
- package/dist/addresses.d.ts +6 -0
- package/dist/addresses.js +7 -7
- package/dist/addresses.mjs +2 -2
- package/dist/builders/DynamicAuctionBuilder.d.mts +2 -0
- package/dist/builders/DynamicAuctionBuilder.d.ts +2 -0
- package/dist/builders/DynamicAuctionBuilder.js +17 -16
- package/dist/builders/DynamicAuctionBuilder.mjs +16 -15
- package/dist/builders/MulticurveBuilder.d.mts +18 -5
- package/dist/builders/MulticurveBuilder.d.ts +18 -5
- package/dist/builders/MulticurveBuilder.js +17 -16
- package/dist/builders/MulticurveBuilder.mjs +16 -15
- package/dist/builders/StaticAuctionBuilder.js +17 -16
- package/dist/builders/StaticAuctionBuilder.mjs +16 -15
- package/dist/builders/index.js +25 -24
- package/dist/builders/index.mjs +18 -17
- package/dist/builders/shared.d.mts +1 -1
- package/dist/builders/shared.d.ts +1 -1
- package/dist/builders/shared.js +19 -17
- package/dist/builders/shared.mjs +15 -13
- package/dist/{chunk-3XYDN2XB.js → chunk-2A3B3NVB.js} +170 -25
- package/dist/chunk-2A3B3NVB.js.map +1 -0
- package/dist/{chunk-AZOBEWP3.mjs → chunk-3NMGCQJ4.mjs} +2 -2
- package/dist/chunk-3NMGCQJ4.mjs.map +1 -0
- package/dist/{chunk-CUB4F546.js → chunk-44CYUEPG.js} +25 -13
- package/dist/chunk-44CYUEPG.js.map +1 -0
- package/dist/{chunk-AZH2P4JK.mjs → chunk-5GQJRNFL.mjs} +3 -3
- package/dist/{chunk-AZH2P4JK.mjs.map → chunk-5GQJRNFL.mjs.map} +1 -1
- package/dist/{chunk-ZDTJ3BPS.js → chunk-5JHXBDZD.js} +20 -20
- package/dist/{chunk-ZDTJ3BPS.js.map → chunk-5JHXBDZD.js.map} +1 -1
- package/dist/{chunk-OGYWNJGI.js → chunk-5TQOT6CW.js} +2 -2
- package/dist/chunk-5TQOT6CW.js.map +1 -0
- package/dist/{chunk-COOVGAOE.js → chunk-65CESA3J.js} +19 -13
- package/dist/chunk-65CESA3J.js.map +1 -0
- package/dist/{chunk-5VV7STYK.js → chunk-7A4DBBXA.js} +141 -101
- package/dist/chunk-7A4DBBXA.js.map +1 -0
- package/dist/chunk-7ZUV6WPX.mjs +3 -0
- package/dist/{chunk-5TL5V6UX.mjs.map → chunk-7ZUV6WPX.mjs.map} +1 -1
- package/dist/{chunk-RXUJ4DUB.js → chunk-A2CJYRRQ.js} +28 -28
- package/dist/{chunk-RXUJ4DUB.js.map → chunk-A2CJYRRQ.js.map} +1 -1
- package/dist/{chunk-QQEOKYEX.js → chunk-BK3S6SVR.js} +383 -83
- package/dist/chunk-BK3S6SVR.js.map +1 -0
- package/dist/{chunk-S4IZ5ATO.js → chunk-BQZTELUX.js} +5 -5
- package/dist/{chunk-S4IZ5ATO.js.map → chunk-BQZTELUX.js.map} +1 -1
- package/dist/{chunk-WKKOBMXR.js → chunk-CFXXUZJY.js} +57 -22
- package/dist/chunk-CFXXUZJY.js.map +1 -0
- package/dist/chunk-DCWF3EMP.js +171 -0
- package/dist/chunk-DCWF3EMP.js.map +1 -0
- package/dist/{chunk-YWK6YH6M.mjs → chunk-DQJXCZU2.mjs} +5 -5
- package/dist/{chunk-YWK6YH6M.mjs.map → chunk-DQJXCZU2.mjs.map} +1 -1
- package/dist/chunk-DSYPZETD.js +4 -0
- package/dist/{chunk-3PNCB4W5.js.map → chunk-DSYPZETD.js.map} +1 -1
- package/dist/chunk-F2BYG63D.mjs +145 -0
- package/dist/chunk-F2BYG63D.mjs.map +1 -0
- package/dist/{chunk-N33R22A2.js → chunk-FNUBKONK.js} +2 -2
- package/dist/{chunk-N33R22A2.js.map → chunk-FNUBKONK.js.map} +1 -1
- package/dist/chunk-FXTGIKQG.mjs +3 -0
- package/dist/{chunk-SD7BHT2F.mjs.map → chunk-FXTGIKQG.mjs.map} +1 -1
- package/dist/{chunk-MQNSJCAW.mjs → chunk-GSBQIVME.mjs} +2 -2
- package/dist/{chunk-MQNSJCAW.mjs.map → chunk-GSBQIVME.mjs.map} +1 -1
- package/dist/{chunk-SAX7P3MH.js → chunk-HJFVRV47.js} +2 -2
- package/dist/{chunk-SAX7P3MH.js.map → chunk-HJFVRV47.js.map} +1 -1
- package/dist/chunk-IIM2CSDQ.js +147 -0
- package/dist/chunk-IIM2CSDQ.js.map +1 -0
- package/dist/{chunk-O3RH43H3.mjs → chunk-IUTIHSLH.mjs} +4 -4
- package/dist/{chunk-O3RH43H3.mjs.map → chunk-IUTIHSLH.mjs.map} +1 -1
- package/dist/chunk-IUZ3BBQP.mjs +117 -0
- package/dist/chunk-IUZ3BBQP.mjs.map +1 -0
- package/dist/{chunk-D7PCIMWU.mjs → chunk-IX4V4UGW.mjs} +4 -4
- package/dist/{chunk-D7PCIMWU.mjs.map → chunk-IX4V4UGW.mjs.map} +1 -1
- package/dist/{chunk-2ZM4JVFC.js → chunk-J62YDWIK.js} +2 -2
- package/dist/chunk-J62YDWIK.js.map +1 -0
- package/dist/{chunk-E2NF4AQB.mjs → chunk-JLUOFAE4.mjs} +272 -12
- package/dist/chunk-JLUOFAE4.mjs.map +1 -0
- package/dist/{chunk-KITPRKQ4.mjs → chunk-LW3CYA27.mjs} +351 -51
- package/dist/chunk-LW3CYA27.mjs.map +1 -0
- package/dist/{chunk-3L4DLMOK.js → chunk-MEA2C5YX.js} +16 -16
- package/dist/{chunk-3L4DLMOK.js.map → chunk-MEA2C5YX.js.map} +1 -1
- package/dist/{chunk-3MVW6UIW.js → chunk-MU56HCUI.js} +273 -11
- package/dist/chunk-MU56HCUI.js.map +1 -0
- package/dist/chunk-OCIY7QEJ.mjs +169 -0
- package/dist/chunk-OCIY7QEJ.mjs.map +1 -0
- package/dist/{chunk-WDSV4O6T.mjs → chunk-OHA5KJ2M.mjs} +2 -2
- package/dist/chunk-OHA5KJ2M.mjs.map +1 -0
- package/dist/{chunk-MT34O3YL.js → chunk-P563HTVU.js} +50 -26
- package/dist/chunk-P563HTVU.js.map +1 -0
- package/dist/{chunk-RLUMYHPI.js → chunk-PGYTMRP3.js} +46 -18
- package/dist/chunk-PGYTMRP3.js.map +1 -0
- package/dist/{chunk-VGOEXLQ2.js → chunk-QAPQGDWK.js} +2 -2
- package/dist/chunk-QAPQGDWK.js.map +1 -0
- package/dist/{chunk-QOGBOT2M.mjs → chunk-QHBKRUBY.mjs} +3 -3
- package/dist/{chunk-QOGBOT2M.mjs.map → chunk-QHBKRUBY.mjs.map} +1 -1
- package/dist/chunk-QOYI7WCH.js +120 -0
- package/dist/chunk-QOYI7WCH.js.map +1 -0
- package/dist/{chunk-OF7BIKXV.js → chunk-QRTABC4Z.js} +2 -2
- package/dist/chunk-QRTABC4Z.js.map +1 -0
- package/dist/{chunk-CS6FVODR.mjs → chunk-QUBD6HUZ.mjs} +163 -18
- package/dist/chunk-QUBD6HUZ.mjs.map +1 -0
- package/dist/{chunk-RWVNXU7Z.mjs → chunk-RDTIXP6S.mjs} +4 -4
- package/dist/{chunk-RWVNXU7Z.mjs.map → chunk-RDTIXP6S.mjs.map} +1 -1
- package/dist/{chunk-5WYXNWNH.js → chunk-RLOZWHRR.js} +11 -11
- package/dist/{chunk-5WYXNWNH.js.map → chunk-RLOZWHRR.js.map} +1 -1
- package/dist/{chunk-VK5HAWX6.mjs → chunk-SWWLOD7Q.mjs} +2 -2
- package/dist/chunk-SWWLOD7Q.mjs.map +1 -0
- package/dist/chunk-T3UA4MJL.js +4 -0
- package/dist/{chunk-WTS75RUC.js.map → chunk-T3UA4MJL.js.map} +1 -1
- package/dist/{chunk-HJ4AS5DZ.mjs → chunk-TEWAXP5C.mjs} +36 -12
- package/dist/chunk-TEWAXP5C.mjs.map +1 -0
- package/dist/{chunk-ZRNPHFP3.mjs → chunk-THEIRDGE.mjs} +50 -15
- package/dist/chunk-THEIRDGE.mjs.map +1 -0
- package/dist/{chunk-LPA32BIK.mjs → chunk-U3GOWK6J.mjs} +2 -2
- package/dist/chunk-U3GOWK6J.mjs.map +1 -0
- package/dist/{chunk-QFQXHDC7.mjs → chunk-VKSD3KXF.mjs} +46 -18
- package/dist/chunk-VKSD3KXF.mjs.map +1 -0
- package/dist/{chunk-64ZQRKG3.mjs → chunk-VYSOAGRU.mjs} +2 -2
- package/dist/chunk-VYSOAGRU.mjs.map +1 -0
- package/dist/{chunk-ADAAU4F5.mjs → chunk-WDC53TM7.mjs} +49 -9
- package/dist/chunk-WDC53TM7.mjs.map +1 -0
- package/dist/{chunk-M2EMKIP5.mjs → chunk-WKWP42TD.mjs} +9 -4
- package/dist/chunk-WKWP42TD.mjs.map +1 -0
- package/dist/{chunk-OROTK4OT.js → chunk-WNUB3UTT.js} +12 -12
- package/dist/chunk-WNUB3UTT.js.map +1 -0
- package/dist/{chunk-FVTTG72Z.mjs → chunk-WNWK2QMU.mjs} +19 -7
- package/dist/chunk-WNWK2QMU.mjs.map +1 -0
- package/dist/{chunk-INLXNN7P.js → chunk-WZF5XNBC.js} +26 -26
- package/dist/{chunk-INLXNN7P.js.map → chunk-WZF5XNBC.js.map} +1 -1
- package/dist/{chunk-SMTHFPBA.js → chunk-XMFOZYNI.js} +2 -2
- package/dist/chunk-XMFOZYNI.js.map +1 -0
- package/dist/{chunk-VGCXJRUV.mjs → chunk-YBK6EBA5.mjs} +10 -10
- package/dist/chunk-YBK6EBA5.mjs.map +1 -0
- package/dist/{chunk-HH7HQ4HC.mjs → chunk-ZEDJUNC6.mjs} +2 -2
- package/dist/{chunk-HH7HQ4HC.mjs.map → chunk-ZEDJUNC6.mjs.map} +1 -1
- package/dist/deployments.generated.d.mts +44 -16
- package/dist/deployments.generated.d.ts +44 -16
- package/dist/deployments.generated.js +2 -2
- package/dist/deployments.generated.mjs +1 -1
- package/dist/entities/DopplerFactory.d.mts +7 -1
- package/dist/entities/DopplerFactory.d.ts +7 -1
- package/dist/entities/DopplerFactory.js +16 -14
- package/dist/entities/DopplerFactory.mjs +15 -13
- package/dist/entities/auction/DynamicAuction.js +10 -10
- package/dist/entities/auction/DynamicAuction.mjs +9 -9
- package/dist/entities/auction/MulticurvePool.d.mts +6 -2
- package/dist/entities/auction/MulticurvePool.d.ts +6 -2
- package/dist/entities/auction/MulticurvePool.js +11 -11
- package/dist/entities/auction/MulticurvePool.mjs +10 -10
- package/dist/entities/auction/RehypeDopplerHook.d.mts +57 -0
- package/dist/entities/auction/RehypeDopplerHook.d.ts +57 -0
- package/dist/entities/auction/RehypeDopplerHook.js +34 -0
- package/dist/entities/auction/RehypeDopplerHook.js.map +1 -0
- package/dist/entities/auction/RehypeDopplerHook.mjs +25 -0
- package/dist/entities/auction/RehypeDopplerHook.mjs.map +1 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.d.mts +48 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.d.ts +48 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.js +34 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.js.map +1 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.mjs +25 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.mjs.map +1 -0
- package/dist/entities/auction/StaticAuction.js +10 -10
- package/dist/entities/auction/StaticAuction.mjs +9 -9
- package/dist/entities/auction/index.d.mts +2 -0
- package/dist/entities/auction/index.d.ts +2 -0
- package/dist/entities/auction/index.js +38 -18
- package/dist/entities/auction/index.mjs +25 -13
- package/dist/entities/quoter/Quoter.js +10 -10
- package/dist/entities/quoter/Quoter.mjs +9 -9
- package/dist/entities/quoter/index.js +10 -10
- package/dist/entities/quoter/index.mjs +9 -9
- package/dist/entities/token/derc20/Derc20.js +8 -8
- package/dist/entities/token/derc20/Derc20.mjs +7 -7
- package/dist/entities/token/derc20/index.js +8 -8
- package/dist/entities/token/derc20/index.mjs +7 -7
- package/dist/entities/token/index.js +11 -11
- package/dist/entities/token/index.mjs +7 -7
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +120 -93
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -25
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +90 -7
- package/dist/types.d.ts +90 -7
- package/dist/types.js +12 -8
- package/dist/types.mjs +3 -3
- package/dist/utils/airlock.js +7 -7
- package/dist/utils/airlock.mjs +3 -3
- package/dist/utils/dopplerHookMigrator.d.mts +18 -0
- package/dist/utils/dopplerHookMigrator.d.ts +18 -0
- package/dist/utils/dopplerHookMigrator.js +20 -0
- package/dist/utils/dopplerHookMigrator.js.map +1 -0
- package/dist/utils/dopplerHookMigrator.mjs +7 -0
- package/dist/utils/dopplerHookMigrator.mjs.map +1 -0
- package/dist/utils/index.d.mts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +39 -32
- package/dist/utils/index.mjs +15 -12
- package/dist/utils/marketCapHelpers.js +13 -13
- package/dist/utils/marketCapHelpers.mjs +1 -1
- package/dist/utils/tokenAddressMiner.js +8 -8
- package/dist/utils/tokenAddressMiner.mjs +7 -7
- package/package.json +2 -2
- package/dist/chunk-2ZM4JVFC.js.map +0 -1
- package/dist/chunk-3MVW6UIW.js.map +0 -1
- package/dist/chunk-3PNCB4W5.js +0 -4
- package/dist/chunk-3XYDN2XB.js.map +0 -1
- package/dist/chunk-5TL5V6UX.mjs +0 -3
- package/dist/chunk-5VV7STYK.js.map +0 -1
- package/dist/chunk-64ZQRKG3.mjs.map +0 -1
- package/dist/chunk-ADAAU4F5.mjs.map +0 -1
- package/dist/chunk-AZOBEWP3.mjs.map +0 -1
- package/dist/chunk-COOVGAOE.js.map +0 -1
- package/dist/chunk-CS6FVODR.mjs.map +0 -1
- package/dist/chunk-CUB4F546.js.map +0 -1
- package/dist/chunk-E2NF4AQB.mjs.map +0 -1
- package/dist/chunk-FVTTG72Z.mjs.map +0 -1
- package/dist/chunk-HJ4AS5DZ.mjs.map +0 -1
- package/dist/chunk-KITPRKQ4.mjs.map +0 -1
- package/dist/chunk-LPA32BIK.mjs.map +0 -1
- package/dist/chunk-M2EMKIP5.mjs.map +0 -1
- package/dist/chunk-MT34O3YL.js.map +0 -1
- package/dist/chunk-OF7BIKXV.js.map +0 -1
- package/dist/chunk-OGYWNJGI.js.map +0 -1
- package/dist/chunk-OROTK4OT.js.map +0 -1
- package/dist/chunk-QFQXHDC7.mjs.map +0 -1
- package/dist/chunk-QQEOKYEX.js.map +0 -1
- package/dist/chunk-RLUMYHPI.js.map +0 -1
- package/dist/chunk-SD7BHT2F.mjs +0 -3
- package/dist/chunk-SMTHFPBA.js.map +0 -1
- package/dist/chunk-VGCXJRUV.mjs.map +0 -1
- package/dist/chunk-VGOEXLQ2.js.map +0 -1
- package/dist/chunk-VK5HAWX6.mjs.map +0 -1
- package/dist/chunk-WDSV4O6T.mjs.map +0 -1
- package/dist/chunk-WKKOBMXR.js.map +0 -1
- package/dist/chunk-WTS75RUC.js +0 -4
- package/dist/chunk-ZRNPHFP3.mjs.map +0 -1
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkUPVKABAV_js = require('./chunk-UPVKABAV.js');
|
|
4
|
+
var chunkQOYI7WCH_js = require('./chunk-QOYI7WCH.js');
|
|
4
5
|
var chunk6H6X3VTZ_js = require('./chunk-6H6X3VTZ.js');
|
|
5
6
|
var chunk4VWQNNNW_js = require('./chunk-4VWQNNNW.js');
|
|
6
7
|
var chunk6BQY5EPB_js = require('./chunk-6BQY5EPB.js');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
8
|
+
var chunk7A4DBBXA_js = require('./chunk-7A4DBBXA.js');
|
|
9
|
+
var chunkMU56HCUI_js = require('./chunk-MU56HCUI.js');
|
|
10
|
+
var chunkQRTABC4Z_js = require('./chunk-QRTABC4Z.js');
|
|
11
|
+
var chunkJ62YDWIK_js = require('./chunk-J62YDWIK.js');
|
|
12
|
+
var chunkXMFOZYNI_js = require('./chunk-XMFOZYNI.js');
|
|
13
|
+
var chunkQAPQGDWK_js = require('./chunk-QAPQGDWK.js');
|
|
13
14
|
var viem = require('viem');
|
|
14
15
|
|
|
15
16
|
var MAX_UINT128 = (1n << 128n) - 1n;
|
|
17
|
+
var MAX_PROCEEDS_SPLIT_SHARE = chunk6BQY5EPB_js.WAD / 2n;
|
|
16
18
|
var TOKEN_FACTORY_80_ADDRESS = "0xf0b5141dd9096254b2ca624dff26024f46087229";
|
|
17
19
|
var DopplerFactory = class {
|
|
18
20
|
constructor(publicClient, walletClient, chainId) {
|
|
@@ -32,7 +34,7 @@ var DopplerFactory = class {
|
|
|
32
34
|
}
|
|
33
35
|
async encodeCreateStaticAuctionParams(params) {
|
|
34
36
|
this.validateStaticAuctionParams(params);
|
|
35
|
-
const addresses =
|
|
37
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
36
38
|
const hasBeneficiaries = params.pool.beneficiaries && params.pool.beneficiaries.length > 0;
|
|
37
39
|
let poolInitializerData;
|
|
38
40
|
if (hasBeneficiaries) {
|
|
@@ -101,7 +103,10 @@ var DopplerFactory = class {
|
|
|
101
103
|
]
|
|
102
104
|
);
|
|
103
105
|
}
|
|
104
|
-
const liquidityMigratorData = this.encodeMigrationData(params.migration
|
|
106
|
+
const liquidityMigratorData = this.encodeMigrationData(params.migration, {
|
|
107
|
+
numeraire: params.sale.numeraire,
|
|
108
|
+
overrides: params.modules
|
|
109
|
+
});
|
|
105
110
|
let tokenFactoryData;
|
|
106
111
|
if (this.isDoppler404Token(params.token)) {
|
|
107
112
|
const token404 = params.token;
|
|
@@ -253,11 +258,11 @@ var DopplerFactory = class {
|
|
|
253
258
|
*/
|
|
254
259
|
async simulateCreateStaticAuction(params) {
|
|
255
260
|
const createParams = await this.encodeCreateStaticAuctionParams(params);
|
|
256
|
-
const addresses =
|
|
261
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
257
262
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
258
263
|
const { request, result } = await this.publicClient.simulateContract({
|
|
259
264
|
address: airlockAddress,
|
|
260
|
-
abi:
|
|
265
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
261
266
|
functionName: "create",
|
|
262
267
|
args: [{ ...createParams }],
|
|
263
268
|
account: this.walletClient?.account
|
|
@@ -287,14 +292,14 @@ var DopplerFactory = class {
|
|
|
287
292
|
*/
|
|
288
293
|
async createStaticAuction(params, options) {
|
|
289
294
|
const createParams = options?._createParams ?? (await this.simulateCreateStaticAuction(params)).createParams;
|
|
290
|
-
const addresses =
|
|
295
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
291
296
|
if (!this.walletClient) {
|
|
292
297
|
throw new Error("Wallet client required for write operations");
|
|
293
298
|
}
|
|
294
299
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
295
300
|
const { request, result } = await this.publicClient.simulateContract({
|
|
296
301
|
address: airlockAddress,
|
|
297
|
-
abi:
|
|
302
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
298
303
|
functionName: "create",
|
|
299
304
|
args: [{ ...createParams }],
|
|
300
305
|
account: this.walletClient.account
|
|
@@ -381,7 +386,7 @@ var DopplerFactory = class {
|
|
|
381
386
|
const createEvent = receipt.logs.find((log) => {
|
|
382
387
|
try {
|
|
383
388
|
const decoded2 = viem.decodeEventLog({
|
|
384
|
-
abi:
|
|
389
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
385
390
|
data: log.data,
|
|
386
391
|
topics: log.topics
|
|
387
392
|
});
|
|
@@ -392,7 +397,7 @@ var DopplerFactory = class {
|
|
|
392
397
|
});
|
|
393
398
|
if (!createEvent) return null;
|
|
394
399
|
const decoded = viem.decodeEventLog({
|
|
395
|
-
abi:
|
|
400
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
396
401
|
data: createEvent.data,
|
|
397
402
|
topics: createEvent.topics
|
|
398
403
|
});
|
|
@@ -423,7 +428,7 @@ var DopplerFactory = class {
|
|
|
423
428
|
const createParams = { ...baseCreateParams, salt };
|
|
424
429
|
const { result } = await this.publicClient.simulateContract({
|
|
425
430
|
address: airlockAddress,
|
|
426
|
-
abi:
|
|
431
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
427
432
|
functionName: "create",
|
|
428
433
|
args: [{ ...createParams }],
|
|
429
434
|
account: accountForSimulation
|
|
@@ -450,7 +455,7 @@ var DopplerFactory = class {
|
|
|
450
455
|
}
|
|
451
456
|
async encodeCreateDynamicAuctionParams(params) {
|
|
452
457
|
this.validateDynamicAuctionParams(params);
|
|
453
|
-
const addresses =
|
|
458
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
454
459
|
const gamma = params.auction.gamma ?? chunkUPVKABAV_js.computeOptimalGamma(
|
|
455
460
|
params.auction.startTick,
|
|
456
461
|
params.auction.endTick,
|
|
@@ -555,7 +560,10 @@ var DopplerFactory = class {
|
|
|
555
560
|
poolInitializerData: dopplerData,
|
|
556
561
|
tokenVariant: this.isDoppler404Token(params.token) ? "doppler404" : "standard"
|
|
557
562
|
});
|
|
558
|
-
const liquidityMigratorData = this.encodeMigrationData(params.migration
|
|
563
|
+
const liquidityMigratorData = this.encodeMigrationData(params.migration, {
|
|
564
|
+
numeraire: params.sale.numeraire,
|
|
565
|
+
overrides: params.modules
|
|
566
|
+
});
|
|
559
567
|
const governanceFactoryData = (() => {
|
|
560
568
|
if (params.governance.type === "noOp") {
|
|
561
569
|
return "0x";
|
|
@@ -634,7 +642,7 @@ var DopplerFactory = class {
|
|
|
634
642
|
* @returns The address of the created hook and token
|
|
635
643
|
*/
|
|
636
644
|
async createDynamicAuction(params, options) {
|
|
637
|
-
const addresses =
|
|
645
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
638
646
|
let createParams;
|
|
639
647
|
if (options?._createParams) {
|
|
640
648
|
createParams = options._createParams;
|
|
@@ -648,7 +656,7 @@ var DopplerFactory = class {
|
|
|
648
656
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
649
657
|
const { request, result } = await this.publicClient.simulateContract({
|
|
650
658
|
address: airlockAddress,
|
|
651
|
-
abi:
|
|
659
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
652
660
|
functionName: "create",
|
|
653
661
|
args: [{ ...createParams }],
|
|
654
662
|
account: this.walletClient.account
|
|
@@ -708,11 +716,11 @@ var DopplerFactory = class {
|
|
|
708
716
|
*/
|
|
709
717
|
async simulateCreateDynamicAuction(params) {
|
|
710
718
|
const { createParams } = await this.encodeCreateDynamicAuctionParams(params);
|
|
711
|
-
const addresses =
|
|
719
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
712
720
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
713
721
|
const { request, result } = await this.publicClient.simulateContract({
|
|
714
722
|
address: airlockAddress,
|
|
715
|
-
abi:
|
|
723
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
716
724
|
functionName: "create",
|
|
717
725
|
args: [{ ...createParams }],
|
|
718
726
|
account: this.walletClient?.account
|
|
@@ -754,7 +762,7 @@ var DopplerFactory = class {
|
|
|
754
762
|
try {
|
|
755
763
|
const estimated = await this.publicClient.estimateContractGas({
|
|
756
764
|
address,
|
|
757
|
-
abi:
|
|
765
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
758
766
|
functionName: "create",
|
|
759
767
|
args: [{ ...createParams }],
|
|
760
768
|
account
|
|
@@ -771,7 +779,7 @@ var DopplerFactory = class {
|
|
|
771
779
|
* Encode migration data based on the MigrationConfig
|
|
772
780
|
* This replaces the manual encoding methods from the old SDKs
|
|
773
781
|
*/
|
|
774
|
-
encodeMigrationData(config) {
|
|
782
|
+
encodeMigrationData(config, options) {
|
|
775
783
|
if (this.customMigrationEncoder) {
|
|
776
784
|
return this.customMigrationEncoder(config);
|
|
777
785
|
}
|
|
@@ -815,6 +823,77 @@ var DopplerFactory = class {
|
|
|
815
823
|
beneficiaryData
|
|
816
824
|
]
|
|
817
825
|
);
|
|
826
|
+
case "dopplerHook": {
|
|
827
|
+
const dopplerHookConfig = config;
|
|
828
|
+
if (dopplerHookConfig.hook && dopplerHookConfig.rehype) {
|
|
829
|
+
throw new Error(
|
|
830
|
+
"dopplerHook migration cannot set both hook and rehype config. Use exactly one hook mode."
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
const beneficiaries = [...dopplerHookConfig.beneficiaries].sort(
|
|
834
|
+
(a, b) => {
|
|
835
|
+
const addrA = a.beneficiary.toLowerCase();
|
|
836
|
+
const addrB = b.beneficiary.toLowerCase();
|
|
837
|
+
return addrA < addrB ? -1 : addrA > addrB ? 1 : 0;
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
let dopplerHookAddress = chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
841
|
+
let onInitializationCalldata = "0x";
|
|
842
|
+
if (dopplerHookConfig.hook) {
|
|
843
|
+
dopplerHookAddress = dopplerHookConfig.hook.hookAddress;
|
|
844
|
+
onInitializationCalldata = dopplerHookConfig.hook.onInitializationCalldata ?? "0x";
|
|
845
|
+
} else if (dopplerHookConfig.rehype) {
|
|
846
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
847
|
+
const resolvedRehypeHookAddress = dopplerHookConfig.rehype.hookAddress ?? options?.overrides?.rehypeDopplerHookMigrator ?? addresses.rehypeDopplerHookMigrator;
|
|
848
|
+
if (!resolvedRehypeHookAddress) {
|
|
849
|
+
throw new Error(
|
|
850
|
+
"RehypeDopplerHookMigrator address not configured on this chain. Provide migration.rehype.hookAddress or override modules.rehypeDopplerHookMigrator."
|
|
851
|
+
);
|
|
852
|
+
}
|
|
853
|
+
if (!options?.numeraire) {
|
|
854
|
+
throw new Error(
|
|
855
|
+
"numeraire is required to encode rehype dopplerHook migration data"
|
|
856
|
+
);
|
|
857
|
+
}
|
|
858
|
+
dopplerHookAddress = resolvedRehypeHookAddress;
|
|
859
|
+
onInitializationCalldata = chunkQOYI7WCH_js.encodeRehypeDopplerHookMigratorCalldata({
|
|
860
|
+
numeraire: options.numeraire,
|
|
861
|
+
config: dopplerHookConfig.rehype
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
const proceedsRecipient = dopplerHookConfig.proceedsSplit?.recipient ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
865
|
+
const proceedsShare = dopplerHookConfig.proceedsSplit?.share ?? 0n;
|
|
866
|
+
return viem.encodeAbiParameters(
|
|
867
|
+
[
|
|
868
|
+
{ type: "uint24" },
|
|
869
|
+
{ type: "bool" },
|
|
870
|
+
{ type: "int24" },
|
|
871
|
+
{ type: "uint32" },
|
|
872
|
+
{
|
|
873
|
+
type: "tuple[]",
|
|
874
|
+
components: [
|
|
875
|
+
{ type: "address", name: "beneficiary" },
|
|
876
|
+
{ type: "uint96", name: "shares" }
|
|
877
|
+
]
|
|
878
|
+
},
|
|
879
|
+
{ type: "address" },
|
|
880
|
+
{ type: "bytes" },
|
|
881
|
+
{ type: "address" },
|
|
882
|
+
{ type: "uint256" }
|
|
883
|
+
],
|
|
884
|
+
[
|
|
885
|
+
dopplerHookConfig.fee,
|
|
886
|
+
dopplerHookConfig.useDynamicFee ?? false,
|
|
887
|
+
dopplerHookConfig.tickSpacing,
|
|
888
|
+
dopplerHookConfig.lockDuration,
|
|
889
|
+
beneficiaries,
|
|
890
|
+
dopplerHookAddress,
|
|
891
|
+
onInitializationCalldata,
|
|
892
|
+
proceedsRecipient,
|
|
893
|
+
proceedsShare
|
|
894
|
+
]
|
|
895
|
+
);
|
|
896
|
+
}
|
|
818
897
|
default:
|
|
819
898
|
throw new Error("Unknown migration type");
|
|
820
899
|
}
|
|
@@ -840,6 +919,131 @@ var DopplerFactory = class {
|
|
|
840
919
|
}
|
|
841
920
|
return normalized;
|
|
842
921
|
}
|
|
922
|
+
normalizeRehypeStartingTime(value, label) {
|
|
923
|
+
if (value === void 0) return 0;
|
|
924
|
+
if (value instanceof Date) {
|
|
925
|
+
return this.normalizeUint32(Math.floor(value.getTime() / 1e3), label);
|
|
926
|
+
}
|
|
927
|
+
return this.normalizeUint32(value, label);
|
|
928
|
+
}
|
|
929
|
+
normalizeRehypeFeeRoutingMode(mode) {
|
|
930
|
+
if (mode === void 0 || mode === 0 /* DirectBuyback */) {
|
|
931
|
+
return 0 /* DirectBuyback */;
|
|
932
|
+
}
|
|
933
|
+
if (mode === 1 /* RouteToBeneficiaryFees */) {
|
|
934
|
+
return 1 /* RouteToBeneficiaryFees */;
|
|
935
|
+
}
|
|
936
|
+
if (mode === "directBuyback") {
|
|
937
|
+
return 0 /* DirectBuyback */;
|
|
938
|
+
}
|
|
939
|
+
if (mode === "routeToBeneficiaryFees") {
|
|
940
|
+
return 1 /* RouteToBeneficiaryFees */;
|
|
941
|
+
}
|
|
942
|
+
throw new Error(
|
|
943
|
+
"Rehype feeRoutingMode must be DirectBuyback/directBuyback or RouteToBeneficiaryFees/routeToBeneficiaryFees"
|
|
944
|
+
);
|
|
945
|
+
}
|
|
946
|
+
resolveRehypeFeeDistributionInfo(config) {
|
|
947
|
+
if (config.feeDistributionInfo) {
|
|
948
|
+
return config.feeDistributionInfo;
|
|
949
|
+
}
|
|
950
|
+
const assetBuyback = config.assetBuybackPercentWad;
|
|
951
|
+
const numeraireBuyback = config.numeraireBuybackPercentWad;
|
|
952
|
+
const beneficiary = config.beneficiaryPercentWad;
|
|
953
|
+
const lp = config.lpPercentWad;
|
|
954
|
+
if (assetBuyback === void 0 || numeraireBuyback === void 0 || beneficiary === void 0 || lp === void 0) {
|
|
955
|
+
throw new Error(
|
|
956
|
+
"Rehype feeDistributionInfo is required, or provide all deprecated legacy percentages."
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
return {
|
|
960
|
+
assetFeesToAssetBuybackWad: assetBuyback,
|
|
961
|
+
assetFeesToNumeraireBuybackWad: numeraireBuyback,
|
|
962
|
+
assetFeesToBeneficiaryWad: beneficiary,
|
|
963
|
+
assetFeesToLpWad: lp,
|
|
964
|
+
numeraireFeesToAssetBuybackWad: assetBuyback,
|
|
965
|
+
numeraireFeesToNumeraireBuybackWad: numeraireBuyback,
|
|
966
|
+
numeraireFeesToBeneficiaryWad: beneficiary,
|
|
967
|
+
numeraireFeesToLpWad: lp
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
validateRehypeFeeDistributionInfo(feeDistributionInfo) {
|
|
971
|
+
const assetRowTotal = feeDistributionInfo.assetFeesToAssetBuybackWad + feeDistributionInfo.assetFeesToNumeraireBuybackWad + feeDistributionInfo.assetFeesToBeneficiaryWad + feeDistributionInfo.assetFeesToLpWad;
|
|
972
|
+
if (assetRowTotal !== chunk6BQY5EPB_js.WAD) {
|
|
973
|
+
throw new Error(
|
|
974
|
+
`Rehype asset fee distribution must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${assetRowTotal}`
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
const numeraireRowTotal = feeDistributionInfo.numeraireFeesToAssetBuybackWad + feeDistributionInfo.numeraireFeesToNumeraireBuybackWad + feeDistributionInfo.numeraireFeesToBeneficiaryWad + feeDistributionInfo.numeraireFeesToLpWad;
|
|
978
|
+
if (numeraireRowTotal !== chunk6BQY5EPB_js.WAD) {
|
|
979
|
+
throw new Error(
|
|
980
|
+
`Rehype numeraire fee distribution must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${numeraireRowTotal}`
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
normalizeRehypeHookConfig(config) {
|
|
985
|
+
const MAX_REHYPE_FEE = 1e6;
|
|
986
|
+
const startFeeRaw = config.startFee ?? config.customFee;
|
|
987
|
+
if (startFeeRaw === void 0) {
|
|
988
|
+
throw new Error(
|
|
989
|
+
"Rehype startFee is required, or provide deprecated customFee."
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
const endFeeRaw = config.endFee ?? startFeeRaw;
|
|
993
|
+
const startFee = Number(startFeeRaw);
|
|
994
|
+
const endFee = Number(endFeeRaw);
|
|
995
|
+
if (!Number.isInteger(startFee) || startFee < 0 || startFee > MAX_REHYPE_FEE) {
|
|
996
|
+
throw new Error(
|
|
997
|
+
`Rehype startFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
if (!Number.isInteger(endFee) || endFee < 0 || endFee > MAX_REHYPE_FEE) {
|
|
1001
|
+
throw new Error(
|
|
1002
|
+
`Rehype endFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
|
|
1003
|
+
);
|
|
1004
|
+
}
|
|
1005
|
+
if (startFee < endFee) {
|
|
1006
|
+
throw new Error(
|
|
1007
|
+
`Rehype startFee (${startFee}) must be greater than or equal to endFee (${endFee})`
|
|
1008
|
+
);
|
|
1009
|
+
}
|
|
1010
|
+
const durationRaw = config.durationSeconds ?? (startFee === endFee ? 0 : void 0);
|
|
1011
|
+
if (durationRaw === void 0) {
|
|
1012
|
+
throw new Error(
|
|
1013
|
+
"Rehype durationSeconds must be provided when startFee is greater than endFee."
|
|
1014
|
+
);
|
|
1015
|
+
}
|
|
1016
|
+
const durationSeconds = this.normalizeUint32(
|
|
1017
|
+
durationRaw,
|
|
1018
|
+
"Rehype durationSeconds"
|
|
1019
|
+
);
|
|
1020
|
+
if (startFee > endFee && durationSeconds <= 0) {
|
|
1021
|
+
throw new Error(
|
|
1022
|
+
"Rehype durationSeconds must be greater than 0 when startFee is greater than endFee."
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
const startingTime = this.normalizeRehypeStartingTime(
|
|
1026
|
+
config.startingTime,
|
|
1027
|
+
"Rehype startingTime"
|
|
1028
|
+
);
|
|
1029
|
+
const feeRoutingMode = this.normalizeRehypeFeeRoutingMode(
|
|
1030
|
+
config.feeRoutingMode
|
|
1031
|
+
);
|
|
1032
|
+
const feeDistributionInfo = this.resolveRehypeFeeDistributionInfo(config);
|
|
1033
|
+
this.validateRehypeFeeDistributionInfo(feeDistributionInfo);
|
|
1034
|
+
return {
|
|
1035
|
+
hookAddress: config.hookAddress,
|
|
1036
|
+
buybackDestination: config.buybackDestination,
|
|
1037
|
+
startFee,
|
|
1038
|
+
endFee,
|
|
1039
|
+
durationSeconds,
|
|
1040
|
+
startingTime,
|
|
1041
|
+
feeRoutingMode,
|
|
1042
|
+
feeDistributionInfo,
|
|
1043
|
+
graduationCalldata: config.graduationCalldata,
|
|
1044
|
+
farTick: config.farTick
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
843
1047
|
resolveMulticurveInitializerMode(params) {
|
|
844
1048
|
const legacySchedule = params.schedule;
|
|
845
1049
|
const legacyHook = params.dopplerHook;
|
|
@@ -988,7 +1192,7 @@ var DopplerFactory = class {
|
|
|
988
1192
|
params.pool.curves,
|
|
989
1193
|
params.pool.tickSpacing
|
|
990
1194
|
);
|
|
991
|
-
const addresses =
|
|
1195
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
992
1196
|
const sortedBeneficiaries = (params.pool.beneficiaries ?? []).slice().sort(
|
|
993
1197
|
(a, b) => {
|
|
994
1198
|
const aAddr = a.beneficiary.toLowerCase();
|
|
@@ -1000,15 +1204,7 @@ var DopplerFactory = class {
|
|
|
1000
1204
|
const useScheduledInitializer = initializerMode.type === "scheduled";
|
|
1001
1205
|
const useDecayInitializer = initializerMode.type === "decay";
|
|
1002
1206
|
const useDopplerHookInitializer = initializerMode.type === "rehype";
|
|
1003
|
-
|
|
1004
|
-
const hook = initializerMode.hookConfig;
|
|
1005
|
-
const totalDistribution = hook.assetBuybackPercentWad + hook.numeraireBuybackPercentWad + hook.beneficiaryPercentWad + hook.lpPercentWad;
|
|
1006
|
-
if (totalDistribution !== chunk6BQY5EPB_js.WAD) {
|
|
1007
|
-
throw new Error(
|
|
1008
|
-
`DopplerHook fee distribution must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${totalDistribution}`
|
|
1009
|
-
);
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1207
|
+
const normalizedRehypeHookConfig = initializerMode.type === "rehype" && initializerMode.hookConfig ? this.normalizeRehypeHookConfig(initializerMode.hookConfig) : void 0;
|
|
1012
1208
|
const curveComponents = [
|
|
1013
1209
|
{ type: "int24", name: "tickLower" },
|
|
1014
1210
|
{ type: "int24", name: "tickUpper" },
|
|
@@ -1035,44 +1231,56 @@ var DopplerFactory = class {
|
|
|
1035
1231
|
);
|
|
1036
1232
|
let poolInitializerData;
|
|
1037
1233
|
if (useDopplerHookInitializer) {
|
|
1038
|
-
const hookConfig =
|
|
1234
|
+
const hookConfig = normalizedRehypeHookConfig;
|
|
1039
1235
|
let farTick;
|
|
1040
1236
|
if (hookConfig?.farTick !== void 0) {
|
|
1041
1237
|
farTick = hookConfig.farTick;
|
|
1042
1238
|
} else {
|
|
1043
|
-
const allTickUppers =
|
|
1044
|
-
farTick = Math.max(...allTickUppers);
|
|
1239
|
+
const allTickUppers = normalizedCurves.map((c) => c.tickUpper);
|
|
1240
|
+
farTick = Math.max(...allTickUppers) - params.pool.tickSpacing;
|
|
1045
1241
|
}
|
|
1046
1242
|
let onInitializationDopplerHookCalldata = "0x";
|
|
1047
1243
|
let graduationDopplerHookCalldata = "0x";
|
|
1048
1244
|
let dopplerHookAddress = chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
1049
1245
|
if (hookConfig) {
|
|
1050
1246
|
dopplerHookAddress = hookConfig.hookAddress;
|
|
1247
|
+
const feeDistributionComponents = [
|
|
1248
|
+
{ name: "assetFeesToAssetBuybackWad", type: "uint256" },
|
|
1249
|
+
{ name: "assetFeesToNumeraireBuybackWad", type: "uint256" },
|
|
1250
|
+
{ name: "assetFeesToBeneficiaryWad", type: "uint256" },
|
|
1251
|
+
{ name: "assetFeesToLpWad", type: "uint256" },
|
|
1252
|
+
{ name: "numeraireFeesToAssetBuybackWad", type: "uint256" },
|
|
1253
|
+
{ name: "numeraireFeesToNumeraireBuybackWad", type: "uint256" },
|
|
1254
|
+
{ name: "numeraireFeesToBeneficiaryWad", type: "uint256" },
|
|
1255
|
+
{ name: "numeraireFeesToLpWad", type: "uint256" }
|
|
1256
|
+
];
|
|
1257
|
+
const rehypeInitDataComponents = [
|
|
1258
|
+
{ name: "numeraire", type: "address" },
|
|
1259
|
+
{ name: "buybackDst", type: "address" },
|
|
1260
|
+
{ name: "startFee", type: "uint24" },
|
|
1261
|
+
{ name: "endFee", type: "uint24" },
|
|
1262
|
+
{ name: "durationSeconds", type: "uint32" },
|
|
1263
|
+
{ name: "startingTime", type: "uint32" },
|
|
1264
|
+
{ name: "feeRoutingMode", type: "uint8" },
|
|
1265
|
+
{
|
|
1266
|
+
name: "feeDistributionInfo",
|
|
1267
|
+
type: "tuple",
|
|
1268
|
+
components: feeDistributionComponents
|
|
1269
|
+
}
|
|
1270
|
+
];
|
|
1051
1271
|
onInitializationDopplerHookCalldata = viem.encodeAbiParameters(
|
|
1272
|
+
[{ type: "tuple", components: rehypeInitDataComponents }],
|
|
1052
1273
|
[
|
|
1053
|
-
{
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
{ type: "uint256" },
|
|
1064
|
-
// beneficiaryPercentWad
|
|
1065
|
-
{ type: "uint256" }
|
|
1066
|
-
// lpPercentWad
|
|
1067
|
-
],
|
|
1068
|
-
[
|
|
1069
|
-
params.sale.numeraire,
|
|
1070
|
-
hookConfig.buybackDestination,
|
|
1071
|
-
hookConfig.customFee,
|
|
1072
|
-
hookConfig.assetBuybackPercentWad,
|
|
1073
|
-
hookConfig.numeraireBuybackPercentWad,
|
|
1074
|
-
hookConfig.beneficiaryPercentWad,
|
|
1075
|
-
hookConfig.lpPercentWad
|
|
1274
|
+
{
|
|
1275
|
+
numeraire: params.sale.numeraire,
|
|
1276
|
+
buybackDst: hookConfig.buybackDestination,
|
|
1277
|
+
startFee: hookConfig.startFee,
|
|
1278
|
+
endFee: hookConfig.endFee,
|
|
1279
|
+
durationSeconds: hookConfig.durationSeconds,
|
|
1280
|
+
startingTime: hookConfig.startingTime,
|
|
1281
|
+
feeRoutingMode: hookConfig.feeRoutingMode,
|
|
1282
|
+
feeDistributionInfo: hookConfig.feeDistributionInfo
|
|
1283
|
+
}
|
|
1076
1284
|
]
|
|
1077
1285
|
);
|
|
1078
1286
|
graduationDopplerHookCalldata = hookConfig.graduationCalldata ?? "0x";
|
|
@@ -1311,7 +1519,10 @@ var DopplerFactory = class {
|
|
|
1311
1519
|
);
|
|
1312
1520
|
}
|
|
1313
1521
|
} else {
|
|
1314
|
-
liquidityMigratorData = this.encodeMigrationData(params.migration
|
|
1522
|
+
liquidityMigratorData = this.encodeMigrationData(params.migration, {
|
|
1523
|
+
numeraire: params.sale.numeraire,
|
|
1524
|
+
overrides: params.modules
|
|
1525
|
+
});
|
|
1315
1526
|
resolvedMigrator = this.getMigratorAddress(
|
|
1316
1527
|
params.migration,
|
|
1317
1528
|
params.modules
|
|
@@ -1367,12 +1578,12 @@ var DopplerFactory = class {
|
|
|
1367
1578
|
return createParams;
|
|
1368
1579
|
}
|
|
1369
1580
|
async simulateCreateMulticurve(params) {
|
|
1370
|
-
const addresses =
|
|
1581
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
1371
1582
|
const createParams = this.encodeCreateMulticurveParams(params);
|
|
1372
1583
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
1373
1584
|
const { request, result } = await this.publicClient.simulateContract({
|
|
1374
1585
|
address: airlockAddress,
|
|
1375
|
-
abi:
|
|
1586
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
1376
1587
|
functionName: "create",
|
|
1377
1588
|
args: [{ ...createParams }],
|
|
1378
1589
|
account: this.walletClient?.account
|
|
@@ -1398,14 +1609,14 @@ var DopplerFactory = class {
|
|
|
1398
1609
|
};
|
|
1399
1610
|
}
|
|
1400
1611
|
async createMulticurve(params, options) {
|
|
1401
|
-
const addresses =
|
|
1612
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
1402
1613
|
if (!this.walletClient)
|
|
1403
1614
|
throw new Error("Wallet client required for write operations");
|
|
1404
1615
|
const createParams = options?._createParams ?? (await this.simulateCreateMulticurve(params)).createParams;
|
|
1405
1616
|
const airlockAddress = params.modules?.airlock ?? addresses.airlock;
|
|
1406
1617
|
const { request, result } = await this.publicClient.simulateContract({
|
|
1407
1618
|
address: airlockAddress,
|
|
1408
|
-
abi:
|
|
1619
|
+
abi: chunkMU56HCUI_js.airlockAbi,
|
|
1409
1620
|
functionName: "create",
|
|
1410
1621
|
args: [{ ...createParams }],
|
|
1411
1622
|
account: this.walletClient.account
|
|
@@ -1572,6 +1783,11 @@ var DopplerFactory = class {
|
|
|
1572
1783
|
}
|
|
1573
1784
|
}
|
|
1574
1785
|
}
|
|
1786
|
+
if (params.migration.type === "dopplerHook") {
|
|
1787
|
+
throw new Error(
|
|
1788
|
+
"dopplerHook migration is only supported for dynamic auctions"
|
|
1789
|
+
);
|
|
1790
|
+
}
|
|
1575
1791
|
if (params.migration.type === "uniswapV4" && params.migration.streamableFees) {
|
|
1576
1792
|
const beneficiaries = params.migration.streamableFees.beneficiaries;
|
|
1577
1793
|
if (beneficiaries.length === 0) {
|
|
@@ -1667,6 +1883,72 @@ var DopplerFactory = class {
|
|
|
1667
1883
|
);
|
|
1668
1884
|
}
|
|
1669
1885
|
}
|
|
1886
|
+
if (params.migration.type === "dopplerHook") {
|
|
1887
|
+
const migration = params.migration;
|
|
1888
|
+
if (!Number.isInteger(migration.fee) || migration.fee < 0) {
|
|
1889
|
+
throw new Error(
|
|
1890
|
+
"DopplerHook migration fee must be a non-negative integer"
|
|
1891
|
+
);
|
|
1892
|
+
}
|
|
1893
|
+
if (migration.fee > 15e4) {
|
|
1894
|
+
throw new Error("DopplerHook migration fee must be <= 150000 (15%)");
|
|
1895
|
+
}
|
|
1896
|
+
if (!Number.isInteger(migration.tickSpacing) || migration.tickSpacing <= 0) {
|
|
1897
|
+
throw new Error(
|
|
1898
|
+
"DopplerHook migration tickSpacing must be a positive integer"
|
|
1899
|
+
);
|
|
1900
|
+
}
|
|
1901
|
+
if (migration.beneficiaries.length === 0) {
|
|
1902
|
+
throw new Error(
|
|
1903
|
+
"At least one beneficiary is required for dopplerHook migration"
|
|
1904
|
+
);
|
|
1905
|
+
}
|
|
1906
|
+
const totalShares = migration.beneficiaries.reduce(
|
|
1907
|
+
(sum, b) => sum + b.shares,
|
|
1908
|
+
0n
|
|
1909
|
+
);
|
|
1910
|
+
if (totalShares !== chunk6BQY5EPB_js.WAD) {
|
|
1911
|
+
throw new Error(
|
|
1912
|
+
`Beneficiary shares must sum to ${chunk6BQY5EPB_js.WAD} (100%), but got ${totalShares}`
|
|
1913
|
+
);
|
|
1914
|
+
}
|
|
1915
|
+
const lockDuration = Number(migration.lockDuration);
|
|
1916
|
+
if (!Number.isInteger(lockDuration) || lockDuration < 0) {
|
|
1917
|
+
throw new Error(
|
|
1918
|
+
"DopplerHook migration lockDuration must be a non-negative integer number of seconds"
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
if (lockDuration > 4294967295) {
|
|
1922
|
+
throw new Error(
|
|
1923
|
+
"DopplerHook migration lockDuration must fit within uint32"
|
|
1924
|
+
);
|
|
1925
|
+
}
|
|
1926
|
+
if (migration.hook && migration.rehype) {
|
|
1927
|
+
throw new Error(
|
|
1928
|
+
"dopplerHook migration cannot set both hook and rehype config. Use exactly one hook mode."
|
|
1929
|
+
);
|
|
1930
|
+
}
|
|
1931
|
+
if (migration.rehype) {
|
|
1932
|
+
chunkQOYI7WCH_js.normalizeRehypeDopplerHookMigratorConfig(migration.rehype);
|
|
1933
|
+
}
|
|
1934
|
+
if (migration.proceedsSplit) {
|
|
1935
|
+
if (migration.proceedsSplit.recipient === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
1936
|
+
throw new Error(
|
|
1937
|
+
"DopplerHook proceeds split recipient cannot be zero address"
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
if (migration.proceedsSplit.share < 0n) {
|
|
1941
|
+
throw new Error(
|
|
1942
|
+
"DopplerHook proceeds split share cannot be negative"
|
|
1943
|
+
);
|
|
1944
|
+
}
|
|
1945
|
+
if (migration.proceedsSplit.share > MAX_PROCEEDS_SPLIT_SHARE) {
|
|
1946
|
+
throw new Error(
|
|
1947
|
+
`DopplerHook proceeds split share cannot exceed ${MAX_PROCEEDS_SPLIT_SHARE}`
|
|
1948
|
+
);
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1670
1952
|
}
|
|
1671
1953
|
/**
|
|
1672
1954
|
* Validate multicurve auction parameters
|
|
@@ -1724,6 +2006,11 @@ var DopplerFactory = class {
|
|
|
1724
2006
|
}
|
|
1725
2007
|
}
|
|
1726
2008
|
}
|
|
2009
|
+
if (params.migration.type === "dopplerHook") {
|
|
2010
|
+
throw new Error(
|
|
2011
|
+
"dopplerHook migration is only supported for dynamic auctions"
|
|
2012
|
+
);
|
|
2013
|
+
}
|
|
1727
2014
|
if (params.migration.type === "uniswapV4" && params.migration.streamableFees) {
|
|
1728
2015
|
const beneficiaries = params.migration.streamableFees.beneficiaries;
|
|
1729
2016
|
if (beneficiaries.length === 0) {
|
|
@@ -1743,14 +2030,14 @@ var DopplerFactory = class {
|
|
|
1743
2030
|
* Get the airlock contract address for the current chain
|
|
1744
2031
|
*/
|
|
1745
2032
|
getAirlockAddress() {
|
|
1746
|
-
const addresses =
|
|
2033
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
1747
2034
|
return addresses.airlock;
|
|
1748
2035
|
}
|
|
1749
2036
|
/**
|
|
1750
2037
|
* Get the appropriate initializer address based on auction type
|
|
1751
2038
|
*/
|
|
1752
2039
|
getInitializerAddress(isStatic) {
|
|
1753
|
-
const addresses =
|
|
2040
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
1754
2041
|
return isStatic ? addresses.v3Initializer : addresses.v4Initializer;
|
|
1755
2042
|
}
|
|
1756
2043
|
/**
|
|
@@ -1758,7 +2045,7 @@ var DopplerFactory = class {
|
|
|
1758
2045
|
* Used to perform atomic create + swap ("bundle") flows for static auctions
|
|
1759
2046
|
*/
|
|
1760
2047
|
getBundlerAddress() {
|
|
1761
|
-
const addresses =
|
|
2048
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
1762
2049
|
const addr = addresses.bundler;
|
|
1763
2050
|
if (!addr || addr === viem.zeroAddress) {
|
|
1764
2051
|
throw new Error("Bundler address not configured for this chain");
|
|
@@ -1770,7 +2057,7 @@ var DopplerFactory = class {
|
|
|
1770
2057
|
* Allows override via ModuleAddressOverrides when provided in params.
|
|
1771
2058
|
*/
|
|
1772
2059
|
getMigratorAddress(config, overrides) {
|
|
1773
|
-
const addresses =
|
|
2060
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
1774
2061
|
switch (config.type) {
|
|
1775
2062
|
case "uniswapV2":
|
|
1776
2063
|
return overrides?.v2Migrator ?? addresses.v2Migrator;
|
|
@@ -1783,6 +2070,15 @@ var DopplerFactory = class {
|
|
|
1783
2070
|
}
|
|
1784
2071
|
return v4Address;
|
|
1785
2072
|
}
|
|
2073
|
+
case "dopplerHook": {
|
|
2074
|
+
const dopplerHookMigratorAddress = overrides?.dopplerHookMigrator ?? addresses.dopplerHookMigrator;
|
|
2075
|
+
if (!dopplerHookMigratorAddress || dopplerHookMigratorAddress === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
2076
|
+
throw new Error(
|
|
2077
|
+
"DopplerHookMigrator not configured on this chain. Provide override via modules.dopplerHookMigrator or use a different migration type."
|
|
2078
|
+
);
|
|
2079
|
+
}
|
|
2080
|
+
return dopplerHookMigratorAddress;
|
|
2081
|
+
}
|
|
1786
2082
|
case "noOp": {
|
|
1787
2083
|
const noOpAddress = overrides?.noOpMigrator ?? addresses.noOpMigrator;
|
|
1788
2084
|
if (!noOpAddress) {
|
|
@@ -1809,7 +2105,7 @@ var DopplerFactory = class {
|
|
|
1809
2105
|
const bundler = this.getBundlerAddress();
|
|
1810
2106
|
const { result } = await this.publicClient.simulateContract({
|
|
1811
2107
|
address: bundler,
|
|
1812
|
-
abi:
|
|
2108
|
+
abi: chunkMU56HCUI_js.bundlerAbi,
|
|
1813
2109
|
functionName: "simulateBundleExactIn",
|
|
1814
2110
|
args: [
|
|
1815
2111
|
{ ...createParams },
|
|
@@ -1832,7 +2128,7 @@ var DopplerFactory = class {
|
|
|
1832
2128
|
const bundler = this.getBundlerAddress();
|
|
1833
2129
|
const { result } = await this.publicClient.simulateContract({
|
|
1834
2130
|
address: bundler,
|
|
1835
|
-
abi:
|
|
2131
|
+
abi: chunkMU56HCUI_js.bundlerAbi,
|
|
1836
2132
|
functionName: "simulateBundleExactOut",
|
|
1837
2133
|
args: [
|
|
1838
2134
|
{ ...createParams },
|
|
@@ -1856,7 +2152,7 @@ var DopplerFactory = class {
|
|
|
1856
2152
|
const hookData = "0x";
|
|
1857
2153
|
const { result } = await this.publicClient.simulateContract({
|
|
1858
2154
|
address: bundler,
|
|
1859
|
-
abi:
|
|
2155
|
+
abi: chunkMU56HCUI_js.bundlerAbi,
|
|
1860
2156
|
functionName: "simulateMulticurveBundleExactOut",
|
|
1861
2157
|
args: [{ ...createParams }, exactAmountOut, hookData]
|
|
1862
2158
|
});
|
|
@@ -1881,7 +2177,7 @@ var DopplerFactory = class {
|
|
|
1881
2177
|
const hookData = "0x";
|
|
1882
2178
|
const { result } = await this.publicClient.simulateContract({
|
|
1883
2179
|
address: bundler,
|
|
1884
|
-
abi:
|
|
2180
|
+
abi: chunkMU56HCUI_js.bundlerAbi,
|
|
1885
2181
|
functionName: "simulateMulticurveBundleExactIn",
|
|
1886
2182
|
args: [{ ...createParams }, exactAmountIn, hookData]
|
|
1887
2183
|
});
|
|
@@ -1904,7 +2200,7 @@ var DopplerFactory = class {
|
|
|
1904
2200
|
const bundler = this.getBundlerAddress();
|
|
1905
2201
|
const { request } = await this.publicClient.simulateContract({
|
|
1906
2202
|
address: bundler,
|
|
1907
|
-
abi:
|
|
2203
|
+
abi: chunkMU56HCUI_js.bundlerAbi,
|
|
1908
2204
|
functionName: "bundle",
|
|
1909
2205
|
args: [{ ...createParams }, commands, inputs],
|
|
1910
2206
|
account: this.walletClient.account,
|
|
@@ -2095,7 +2391,7 @@ var DopplerFactory = class {
|
|
|
2095
2391
|
const hookInitHash = viem.keccak256(
|
|
2096
2392
|
viem.encodePacked(
|
|
2097
2393
|
["bytes", "bytes"],
|
|
2098
|
-
[
|
|
2394
|
+
[chunkXMFOZYNI_js.doppler_default, hookInitHashData]
|
|
2099
2395
|
)
|
|
2100
2396
|
);
|
|
2101
2397
|
const tokenFactoryData = params.tokenVariant === "doppler404" ? (() => {
|
|
@@ -2158,7 +2454,7 @@ var DopplerFactory = class {
|
|
|
2158
2454
|
tokenInitHash = viem.keccak256(
|
|
2159
2455
|
viem.encodePacked(
|
|
2160
2456
|
["bytes", "bytes"],
|
|
2161
|
-
[
|
|
2457
|
+
[chunkQAPQGDWK_js.dopplerDN404_default, initHashData]
|
|
2162
2458
|
)
|
|
2163
2459
|
);
|
|
2164
2460
|
} else {
|
|
@@ -2199,7 +2495,7 @@ var DopplerFactory = class {
|
|
|
2199
2495
|
]
|
|
2200
2496
|
);
|
|
2201
2497
|
const isTokenFactory80 = params.tokenFactory.toLowerCase() === TOKEN_FACTORY_80_ADDRESS;
|
|
2202
|
-
const bytecode = isTokenFactory80 ?
|
|
2498
|
+
const bytecode = isTokenFactory80 ? chunkJ62YDWIK_js.derc2080_default : params.customDerc20Bytecode ?? chunkQRTABC4Z_js.derc20_default;
|
|
2203
2499
|
tokenInitHash = viem.keccak256(
|
|
2204
2500
|
viem.encodePacked(["bytes", "bytes"], [bytecode, initHashData])
|
|
2205
2501
|
);
|
|
@@ -2338,14 +2634,18 @@ var DopplerFactory = class {
|
|
|
2338
2634
|
return viem.keccak256(encoded);
|
|
2339
2635
|
}
|
|
2340
2636
|
/**
|
|
2341
|
-
* Compute the V4 poolId for a multicurve pool
|
|
2637
|
+
* Compute the V4 poolId for a multicurve pool from the same pool-key fields
|
|
2638
|
+
* the initializer will register on-chain.
|
|
2342
2639
|
*/
|
|
2343
2640
|
async computeMulticurvePoolId(params, tokenAddress) {
|
|
2344
|
-
const addresses =
|
|
2641
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
2345
2642
|
const initializerMode = this.resolveMulticurveInitializerMode(params);
|
|
2346
2643
|
let hookAddress;
|
|
2347
2644
|
if (initializerMode.type === "rehype") {
|
|
2348
|
-
hookAddress =
|
|
2645
|
+
hookAddress = params.modules?.dopplerHookInitializer ?? addresses.dopplerHookInitializer ?? chunk6BQY5EPB_js.ZERO_ADDRESS;
|
|
2646
|
+
if (hookAddress === chunk6BQY5EPB_js.ZERO_ADDRESS) {
|
|
2647
|
+
throw new Error("DopplerHookInitializer address not configured");
|
|
2648
|
+
}
|
|
2349
2649
|
} else {
|
|
2350
2650
|
const initializerAddress = (() => {
|
|
2351
2651
|
if (initializerMode.type === "decay") {
|
|
@@ -2361,14 +2661,14 @@ var DopplerFactory = class {
|
|
|
2361
2661
|
}
|
|
2362
2662
|
hookAddress = await this.publicClient.readContract({
|
|
2363
2663
|
address: initializerAddress,
|
|
2364
|
-
abi:
|
|
2664
|
+
abi: chunkMU56HCUI_js.v4MulticurveInitializerAbi,
|
|
2365
2665
|
functionName: "HOOK"
|
|
2366
2666
|
});
|
|
2367
2667
|
}
|
|
2368
2668
|
const numeraire = params.sale.numeraire;
|
|
2369
2669
|
const currency0 = tokenAddress < numeraire ? tokenAddress : numeraire;
|
|
2370
2670
|
const currency1 = tokenAddress < numeraire ? numeraire : tokenAddress;
|
|
2371
|
-
const fee = initializerMode.type === "decay" ? chunk6BQY5EPB_js.DYNAMIC_FEE_FLAG : params.pool.fee;
|
|
2671
|
+
const fee = initializerMode.type === "decay" || initializerMode.type === "rehype" && initializerMode.hookConfig ? chunk6BQY5EPB_js.DYNAMIC_FEE_FLAG : params.pool.fee;
|
|
2372
2672
|
return this.computePoolId({
|
|
2373
2673
|
currency0,
|
|
2374
2674
|
currency1,
|
|
@@ -2403,5 +2703,5 @@ var DopplerFactory = class {
|
|
|
2403
2703
|
var MULTICURVE_BUNDLER_SELECTORS = ["0xe2e9faa1", "0x07087b06"];
|
|
2404
2704
|
|
|
2405
2705
|
exports.DopplerFactory = DopplerFactory;
|
|
2406
|
-
//# sourceMappingURL=chunk-
|
|
2407
|
-
//# sourceMappingURL=chunk-
|
|
2706
|
+
//# sourceMappingURL=chunk-BK3S6SVR.js.map
|
|
2707
|
+
//# sourceMappingURL=chunk-BK3S6SVR.js.map
|