@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,16 +1,18 @@
|
|
|
1
1
|
import { computeOptimalGamma } from './chunk-H3B54PFV.mjs';
|
|
2
|
+
import { encodeRehypeDopplerHookMigratorCalldata, normalizeRehypeDopplerHookMigratorConfig } from './chunk-IUZ3BBQP.mjs';
|
|
2
3
|
import { isToken0Expected } from './chunk-ABT6AT7C.mjs';
|
|
3
4
|
import { MIN_TICK, MAX_TICK } from './chunk-25GEBO3B.mjs';
|
|
4
|
-
import { DEFAULT_V3_MAX_SHARE_TO_BE_SOLD, DEFAULT_V3_NUM_POSITIONS, DEFAULT_V4_YEARLY_MINT_RATE, DEFAULT_V3_INITIAL_VOTING_DELAY, DEFAULT_V3_INITIAL_VOTING_PERIOD, DEFAULT_V3_INITIAL_PROPOSAL_THRESHOLD, ZERO_ADDRESS, DEFAULT_CREATE_GAS_LIMIT, DEFAULT_PD_SLUGS, DEFAULT_V4_INITIAL_VOTING_DELAY, DEFAULT_V4_INITIAL_VOTING_PERIOD, DEFAULT_V4_INITIAL_PROPOSAL_THRESHOLD, DECAY_MAX_START_FEE, V4_MAX_FEE,
|
|
5
|
-
import { getAddresses } from './chunk-
|
|
6
|
-
import { airlockAbi, bundlerAbi, v4MulticurveInitializerAbi } from './chunk-
|
|
7
|
-
import { derc20_default } from './chunk-
|
|
8
|
-
import { derc2080_default } from './chunk-
|
|
9
|
-
import { doppler_default } from './chunk-
|
|
10
|
-
import { dopplerDN404_default } from './chunk-
|
|
5
|
+
import { DEFAULT_V3_MAX_SHARE_TO_BE_SOLD, DEFAULT_V3_NUM_POSITIONS, DEFAULT_V4_YEARLY_MINT_RATE, DEFAULT_V3_INITIAL_VOTING_DELAY, DEFAULT_V3_INITIAL_VOTING_PERIOD, DEFAULT_V3_INITIAL_PROPOSAL_THRESHOLD, ZERO_ADDRESS, DEFAULT_CREATE_GAS_LIMIT, DEFAULT_PD_SLUGS, DEFAULT_V4_INITIAL_VOTING_DELAY, DEFAULT_V4_INITIAL_VOTING_PERIOD, DEFAULT_V4_INITIAL_PROPOSAL_THRESHOLD, WAD, DECAY_MAX_START_FEE, V4_MAX_FEE, DEFAULT_V3_YEARLY_MINT_RATE, TICK_SPACINGS, DOPPLER_MAX_TICK_SPACING, FLAG_MASK, DYNAMIC_FEE_FLAG } from './chunk-IWJOPXYN.mjs';
|
|
6
|
+
import { getAddresses } from './chunk-WDC53TM7.mjs';
|
|
7
|
+
import { airlockAbi, bundlerAbi, v4MulticurveInitializerAbi } from './chunk-JLUOFAE4.mjs';
|
|
8
|
+
import { derc20_default } from './chunk-VYSOAGRU.mjs';
|
|
9
|
+
import { derc2080_default } from './chunk-U3GOWK6J.mjs';
|
|
10
|
+
import { doppler_default } from './chunk-SWWLOD7Q.mjs';
|
|
11
|
+
import { dopplerDN404_default } from './chunk-OHA5KJ2M.mjs';
|
|
11
12
|
import { encodeAbiParameters, decodeEventLog, toHex, zeroAddress, keccak256, encodePacked, getAddress } from 'viem';
|
|
12
13
|
|
|
13
14
|
var MAX_UINT128 = (1n << 128n) - 1n;
|
|
15
|
+
var MAX_PROCEEDS_SPLIT_SHARE = WAD / 2n;
|
|
14
16
|
var TOKEN_FACTORY_80_ADDRESS = "0xf0b5141dd9096254b2ca624dff26024f46087229";
|
|
15
17
|
var DopplerFactory = class {
|
|
16
18
|
constructor(publicClient, walletClient, chainId) {
|
|
@@ -99,7 +101,10 @@ var DopplerFactory = class {
|
|
|
99
101
|
]
|
|
100
102
|
);
|
|
101
103
|
}
|
|
102
|
-
const liquidityMigratorData = this.encodeMigrationData(params.migration
|
|
104
|
+
const liquidityMigratorData = this.encodeMigrationData(params.migration, {
|
|
105
|
+
numeraire: params.sale.numeraire,
|
|
106
|
+
overrides: params.modules
|
|
107
|
+
});
|
|
103
108
|
let tokenFactoryData;
|
|
104
109
|
if (this.isDoppler404Token(params.token)) {
|
|
105
110
|
const token404 = params.token;
|
|
@@ -553,7 +558,10 @@ var DopplerFactory = class {
|
|
|
553
558
|
poolInitializerData: dopplerData,
|
|
554
559
|
tokenVariant: this.isDoppler404Token(params.token) ? "doppler404" : "standard"
|
|
555
560
|
});
|
|
556
|
-
const liquidityMigratorData = this.encodeMigrationData(params.migration
|
|
561
|
+
const liquidityMigratorData = this.encodeMigrationData(params.migration, {
|
|
562
|
+
numeraire: params.sale.numeraire,
|
|
563
|
+
overrides: params.modules
|
|
564
|
+
});
|
|
557
565
|
const governanceFactoryData = (() => {
|
|
558
566
|
if (params.governance.type === "noOp") {
|
|
559
567
|
return "0x";
|
|
@@ -769,7 +777,7 @@ var DopplerFactory = class {
|
|
|
769
777
|
* Encode migration data based on the MigrationConfig
|
|
770
778
|
* This replaces the manual encoding methods from the old SDKs
|
|
771
779
|
*/
|
|
772
|
-
encodeMigrationData(config) {
|
|
780
|
+
encodeMigrationData(config, options) {
|
|
773
781
|
if (this.customMigrationEncoder) {
|
|
774
782
|
return this.customMigrationEncoder(config);
|
|
775
783
|
}
|
|
@@ -813,6 +821,77 @@ var DopplerFactory = class {
|
|
|
813
821
|
beneficiaryData
|
|
814
822
|
]
|
|
815
823
|
);
|
|
824
|
+
case "dopplerHook": {
|
|
825
|
+
const dopplerHookConfig = config;
|
|
826
|
+
if (dopplerHookConfig.hook && dopplerHookConfig.rehype) {
|
|
827
|
+
throw new Error(
|
|
828
|
+
"dopplerHook migration cannot set both hook and rehype config. Use exactly one hook mode."
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
const beneficiaries = [...dopplerHookConfig.beneficiaries].sort(
|
|
832
|
+
(a, b) => {
|
|
833
|
+
const addrA = a.beneficiary.toLowerCase();
|
|
834
|
+
const addrB = b.beneficiary.toLowerCase();
|
|
835
|
+
return addrA < addrB ? -1 : addrA > addrB ? 1 : 0;
|
|
836
|
+
}
|
|
837
|
+
);
|
|
838
|
+
let dopplerHookAddress = ZERO_ADDRESS;
|
|
839
|
+
let onInitializationCalldata = "0x";
|
|
840
|
+
if (dopplerHookConfig.hook) {
|
|
841
|
+
dopplerHookAddress = dopplerHookConfig.hook.hookAddress;
|
|
842
|
+
onInitializationCalldata = dopplerHookConfig.hook.onInitializationCalldata ?? "0x";
|
|
843
|
+
} else if (dopplerHookConfig.rehype) {
|
|
844
|
+
const addresses = getAddresses(this.chainId);
|
|
845
|
+
const resolvedRehypeHookAddress = dopplerHookConfig.rehype.hookAddress ?? options?.overrides?.rehypeDopplerHookMigrator ?? addresses.rehypeDopplerHookMigrator;
|
|
846
|
+
if (!resolvedRehypeHookAddress) {
|
|
847
|
+
throw new Error(
|
|
848
|
+
"RehypeDopplerHookMigrator address not configured on this chain. Provide migration.rehype.hookAddress or override modules.rehypeDopplerHookMigrator."
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
if (!options?.numeraire) {
|
|
852
|
+
throw new Error(
|
|
853
|
+
"numeraire is required to encode rehype dopplerHook migration data"
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
dopplerHookAddress = resolvedRehypeHookAddress;
|
|
857
|
+
onInitializationCalldata = encodeRehypeDopplerHookMigratorCalldata({
|
|
858
|
+
numeraire: options.numeraire,
|
|
859
|
+
config: dopplerHookConfig.rehype
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
const proceedsRecipient = dopplerHookConfig.proceedsSplit?.recipient ?? ZERO_ADDRESS;
|
|
863
|
+
const proceedsShare = dopplerHookConfig.proceedsSplit?.share ?? 0n;
|
|
864
|
+
return encodeAbiParameters(
|
|
865
|
+
[
|
|
866
|
+
{ type: "uint24" },
|
|
867
|
+
{ type: "bool" },
|
|
868
|
+
{ type: "int24" },
|
|
869
|
+
{ type: "uint32" },
|
|
870
|
+
{
|
|
871
|
+
type: "tuple[]",
|
|
872
|
+
components: [
|
|
873
|
+
{ type: "address", name: "beneficiary" },
|
|
874
|
+
{ type: "uint96", name: "shares" }
|
|
875
|
+
]
|
|
876
|
+
},
|
|
877
|
+
{ type: "address" },
|
|
878
|
+
{ type: "bytes" },
|
|
879
|
+
{ type: "address" },
|
|
880
|
+
{ type: "uint256" }
|
|
881
|
+
],
|
|
882
|
+
[
|
|
883
|
+
dopplerHookConfig.fee,
|
|
884
|
+
dopplerHookConfig.useDynamicFee ?? false,
|
|
885
|
+
dopplerHookConfig.tickSpacing,
|
|
886
|
+
dopplerHookConfig.lockDuration,
|
|
887
|
+
beneficiaries,
|
|
888
|
+
dopplerHookAddress,
|
|
889
|
+
onInitializationCalldata,
|
|
890
|
+
proceedsRecipient,
|
|
891
|
+
proceedsShare
|
|
892
|
+
]
|
|
893
|
+
);
|
|
894
|
+
}
|
|
816
895
|
default:
|
|
817
896
|
throw new Error("Unknown migration type");
|
|
818
897
|
}
|
|
@@ -838,6 +917,131 @@ var DopplerFactory = class {
|
|
|
838
917
|
}
|
|
839
918
|
return normalized;
|
|
840
919
|
}
|
|
920
|
+
normalizeRehypeStartingTime(value, label) {
|
|
921
|
+
if (value === void 0) return 0;
|
|
922
|
+
if (value instanceof Date) {
|
|
923
|
+
return this.normalizeUint32(Math.floor(value.getTime() / 1e3), label);
|
|
924
|
+
}
|
|
925
|
+
return this.normalizeUint32(value, label);
|
|
926
|
+
}
|
|
927
|
+
normalizeRehypeFeeRoutingMode(mode) {
|
|
928
|
+
if (mode === void 0 || mode === 0 /* DirectBuyback */) {
|
|
929
|
+
return 0 /* DirectBuyback */;
|
|
930
|
+
}
|
|
931
|
+
if (mode === 1 /* RouteToBeneficiaryFees */) {
|
|
932
|
+
return 1 /* RouteToBeneficiaryFees */;
|
|
933
|
+
}
|
|
934
|
+
if (mode === "directBuyback") {
|
|
935
|
+
return 0 /* DirectBuyback */;
|
|
936
|
+
}
|
|
937
|
+
if (mode === "routeToBeneficiaryFees") {
|
|
938
|
+
return 1 /* RouteToBeneficiaryFees */;
|
|
939
|
+
}
|
|
940
|
+
throw new Error(
|
|
941
|
+
"Rehype feeRoutingMode must be DirectBuyback/directBuyback or RouteToBeneficiaryFees/routeToBeneficiaryFees"
|
|
942
|
+
);
|
|
943
|
+
}
|
|
944
|
+
resolveRehypeFeeDistributionInfo(config) {
|
|
945
|
+
if (config.feeDistributionInfo) {
|
|
946
|
+
return config.feeDistributionInfo;
|
|
947
|
+
}
|
|
948
|
+
const assetBuyback = config.assetBuybackPercentWad;
|
|
949
|
+
const numeraireBuyback = config.numeraireBuybackPercentWad;
|
|
950
|
+
const beneficiary = config.beneficiaryPercentWad;
|
|
951
|
+
const lp = config.lpPercentWad;
|
|
952
|
+
if (assetBuyback === void 0 || numeraireBuyback === void 0 || beneficiary === void 0 || lp === void 0) {
|
|
953
|
+
throw new Error(
|
|
954
|
+
"Rehype feeDistributionInfo is required, or provide all deprecated legacy percentages."
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
return {
|
|
958
|
+
assetFeesToAssetBuybackWad: assetBuyback,
|
|
959
|
+
assetFeesToNumeraireBuybackWad: numeraireBuyback,
|
|
960
|
+
assetFeesToBeneficiaryWad: beneficiary,
|
|
961
|
+
assetFeesToLpWad: lp,
|
|
962
|
+
numeraireFeesToAssetBuybackWad: assetBuyback,
|
|
963
|
+
numeraireFeesToNumeraireBuybackWad: numeraireBuyback,
|
|
964
|
+
numeraireFeesToBeneficiaryWad: beneficiary,
|
|
965
|
+
numeraireFeesToLpWad: lp
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
validateRehypeFeeDistributionInfo(feeDistributionInfo) {
|
|
969
|
+
const assetRowTotal = feeDistributionInfo.assetFeesToAssetBuybackWad + feeDistributionInfo.assetFeesToNumeraireBuybackWad + feeDistributionInfo.assetFeesToBeneficiaryWad + feeDistributionInfo.assetFeesToLpWad;
|
|
970
|
+
if (assetRowTotal !== WAD) {
|
|
971
|
+
throw new Error(
|
|
972
|
+
`Rehype asset fee distribution must sum to ${WAD} (100%), but got ${assetRowTotal}`
|
|
973
|
+
);
|
|
974
|
+
}
|
|
975
|
+
const numeraireRowTotal = feeDistributionInfo.numeraireFeesToAssetBuybackWad + feeDistributionInfo.numeraireFeesToNumeraireBuybackWad + feeDistributionInfo.numeraireFeesToBeneficiaryWad + feeDistributionInfo.numeraireFeesToLpWad;
|
|
976
|
+
if (numeraireRowTotal !== WAD) {
|
|
977
|
+
throw new Error(
|
|
978
|
+
`Rehype numeraire fee distribution must sum to ${WAD} (100%), but got ${numeraireRowTotal}`
|
|
979
|
+
);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
normalizeRehypeHookConfig(config) {
|
|
983
|
+
const MAX_REHYPE_FEE = 1e6;
|
|
984
|
+
const startFeeRaw = config.startFee ?? config.customFee;
|
|
985
|
+
if (startFeeRaw === void 0) {
|
|
986
|
+
throw new Error(
|
|
987
|
+
"Rehype startFee is required, or provide deprecated customFee."
|
|
988
|
+
);
|
|
989
|
+
}
|
|
990
|
+
const endFeeRaw = config.endFee ?? startFeeRaw;
|
|
991
|
+
const startFee = Number(startFeeRaw);
|
|
992
|
+
const endFee = Number(endFeeRaw);
|
|
993
|
+
if (!Number.isInteger(startFee) || startFee < 0 || startFee > MAX_REHYPE_FEE) {
|
|
994
|
+
throw new Error(
|
|
995
|
+
`Rehype startFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
|
|
996
|
+
);
|
|
997
|
+
}
|
|
998
|
+
if (!Number.isInteger(endFee) || endFee < 0 || endFee > MAX_REHYPE_FEE) {
|
|
999
|
+
throw new Error(
|
|
1000
|
+
`Rehype endFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
if (startFee < endFee) {
|
|
1004
|
+
throw new Error(
|
|
1005
|
+
`Rehype startFee (${startFee}) must be greater than or equal to endFee (${endFee})`
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
1008
|
+
const durationRaw = config.durationSeconds ?? (startFee === endFee ? 0 : void 0);
|
|
1009
|
+
if (durationRaw === void 0) {
|
|
1010
|
+
throw new Error(
|
|
1011
|
+
"Rehype durationSeconds must be provided when startFee is greater than endFee."
|
|
1012
|
+
);
|
|
1013
|
+
}
|
|
1014
|
+
const durationSeconds = this.normalizeUint32(
|
|
1015
|
+
durationRaw,
|
|
1016
|
+
"Rehype durationSeconds"
|
|
1017
|
+
);
|
|
1018
|
+
if (startFee > endFee && durationSeconds <= 0) {
|
|
1019
|
+
throw new Error(
|
|
1020
|
+
"Rehype durationSeconds must be greater than 0 when startFee is greater than endFee."
|
|
1021
|
+
);
|
|
1022
|
+
}
|
|
1023
|
+
const startingTime = this.normalizeRehypeStartingTime(
|
|
1024
|
+
config.startingTime,
|
|
1025
|
+
"Rehype startingTime"
|
|
1026
|
+
);
|
|
1027
|
+
const feeRoutingMode = this.normalizeRehypeFeeRoutingMode(
|
|
1028
|
+
config.feeRoutingMode
|
|
1029
|
+
);
|
|
1030
|
+
const feeDistributionInfo = this.resolveRehypeFeeDistributionInfo(config);
|
|
1031
|
+
this.validateRehypeFeeDistributionInfo(feeDistributionInfo);
|
|
1032
|
+
return {
|
|
1033
|
+
hookAddress: config.hookAddress,
|
|
1034
|
+
buybackDestination: config.buybackDestination,
|
|
1035
|
+
startFee,
|
|
1036
|
+
endFee,
|
|
1037
|
+
durationSeconds,
|
|
1038
|
+
startingTime,
|
|
1039
|
+
feeRoutingMode,
|
|
1040
|
+
feeDistributionInfo,
|
|
1041
|
+
graduationCalldata: config.graduationCalldata,
|
|
1042
|
+
farTick: config.farTick
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
841
1045
|
resolveMulticurveInitializerMode(params) {
|
|
842
1046
|
const legacySchedule = params.schedule;
|
|
843
1047
|
const legacyHook = params.dopplerHook;
|
|
@@ -998,15 +1202,7 @@ var DopplerFactory = class {
|
|
|
998
1202
|
const useScheduledInitializer = initializerMode.type === "scheduled";
|
|
999
1203
|
const useDecayInitializer = initializerMode.type === "decay";
|
|
1000
1204
|
const useDopplerHookInitializer = initializerMode.type === "rehype";
|
|
1001
|
-
|
|
1002
|
-
const hook = initializerMode.hookConfig;
|
|
1003
|
-
const totalDistribution = hook.assetBuybackPercentWad + hook.numeraireBuybackPercentWad + hook.beneficiaryPercentWad + hook.lpPercentWad;
|
|
1004
|
-
if (totalDistribution !== WAD) {
|
|
1005
|
-
throw new Error(
|
|
1006
|
-
`DopplerHook fee distribution must sum to ${WAD} (100%), but got ${totalDistribution}`
|
|
1007
|
-
);
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1205
|
+
const normalizedRehypeHookConfig = initializerMode.type === "rehype" && initializerMode.hookConfig ? this.normalizeRehypeHookConfig(initializerMode.hookConfig) : void 0;
|
|
1010
1206
|
const curveComponents = [
|
|
1011
1207
|
{ type: "int24", name: "tickLower" },
|
|
1012
1208
|
{ type: "int24", name: "tickUpper" },
|
|
@@ -1033,44 +1229,56 @@ var DopplerFactory = class {
|
|
|
1033
1229
|
);
|
|
1034
1230
|
let poolInitializerData;
|
|
1035
1231
|
if (useDopplerHookInitializer) {
|
|
1036
|
-
const hookConfig =
|
|
1232
|
+
const hookConfig = normalizedRehypeHookConfig;
|
|
1037
1233
|
let farTick;
|
|
1038
1234
|
if (hookConfig?.farTick !== void 0) {
|
|
1039
1235
|
farTick = hookConfig.farTick;
|
|
1040
1236
|
} else {
|
|
1041
|
-
const allTickUppers =
|
|
1042
|
-
farTick = Math.max(...allTickUppers);
|
|
1237
|
+
const allTickUppers = normalizedCurves.map((c) => c.tickUpper);
|
|
1238
|
+
farTick = Math.max(...allTickUppers) - params.pool.tickSpacing;
|
|
1043
1239
|
}
|
|
1044
1240
|
let onInitializationDopplerHookCalldata = "0x";
|
|
1045
1241
|
let graduationDopplerHookCalldata = "0x";
|
|
1046
1242
|
let dopplerHookAddress = ZERO_ADDRESS;
|
|
1047
1243
|
if (hookConfig) {
|
|
1048
1244
|
dopplerHookAddress = hookConfig.hookAddress;
|
|
1245
|
+
const feeDistributionComponents = [
|
|
1246
|
+
{ name: "assetFeesToAssetBuybackWad", type: "uint256" },
|
|
1247
|
+
{ name: "assetFeesToNumeraireBuybackWad", type: "uint256" },
|
|
1248
|
+
{ name: "assetFeesToBeneficiaryWad", type: "uint256" },
|
|
1249
|
+
{ name: "assetFeesToLpWad", type: "uint256" },
|
|
1250
|
+
{ name: "numeraireFeesToAssetBuybackWad", type: "uint256" },
|
|
1251
|
+
{ name: "numeraireFeesToNumeraireBuybackWad", type: "uint256" },
|
|
1252
|
+
{ name: "numeraireFeesToBeneficiaryWad", type: "uint256" },
|
|
1253
|
+
{ name: "numeraireFeesToLpWad", type: "uint256" }
|
|
1254
|
+
];
|
|
1255
|
+
const rehypeInitDataComponents = [
|
|
1256
|
+
{ name: "numeraire", type: "address" },
|
|
1257
|
+
{ name: "buybackDst", type: "address" },
|
|
1258
|
+
{ name: "startFee", type: "uint24" },
|
|
1259
|
+
{ name: "endFee", type: "uint24" },
|
|
1260
|
+
{ name: "durationSeconds", type: "uint32" },
|
|
1261
|
+
{ name: "startingTime", type: "uint32" },
|
|
1262
|
+
{ name: "feeRoutingMode", type: "uint8" },
|
|
1263
|
+
{
|
|
1264
|
+
name: "feeDistributionInfo",
|
|
1265
|
+
type: "tuple",
|
|
1266
|
+
components: feeDistributionComponents
|
|
1267
|
+
}
|
|
1268
|
+
];
|
|
1049
1269
|
onInitializationDopplerHookCalldata = encodeAbiParameters(
|
|
1270
|
+
[{ type: "tuple", components: rehypeInitDataComponents }],
|
|
1050
1271
|
[
|
|
1051
|
-
{
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
{ type: "uint256" },
|
|
1062
|
-
// beneficiaryPercentWad
|
|
1063
|
-
{ type: "uint256" }
|
|
1064
|
-
// lpPercentWad
|
|
1065
|
-
],
|
|
1066
|
-
[
|
|
1067
|
-
params.sale.numeraire,
|
|
1068
|
-
hookConfig.buybackDestination,
|
|
1069
|
-
hookConfig.customFee,
|
|
1070
|
-
hookConfig.assetBuybackPercentWad,
|
|
1071
|
-
hookConfig.numeraireBuybackPercentWad,
|
|
1072
|
-
hookConfig.beneficiaryPercentWad,
|
|
1073
|
-
hookConfig.lpPercentWad
|
|
1272
|
+
{
|
|
1273
|
+
numeraire: params.sale.numeraire,
|
|
1274
|
+
buybackDst: hookConfig.buybackDestination,
|
|
1275
|
+
startFee: hookConfig.startFee,
|
|
1276
|
+
endFee: hookConfig.endFee,
|
|
1277
|
+
durationSeconds: hookConfig.durationSeconds,
|
|
1278
|
+
startingTime: hookConfig.startingTime,
|
|
1279
|
+
feeRoutingMode: hookConfig.feeRoutingMode,
|
|
1280
|
+
feeDistributionInfo: hookConfig.feeDistributionInfo
|
|
1281
|
+
}
|
|
1074
1282
|
]
|
|
1075
1283
|
);
|
|
1076
1284
|
graduationDopplerHookCalldata = hookConfig.graduationCalldata ?? "0x";
|
|
@@ -1309,7 +1517,10 @@ var DopplerFactory = class {
|
|
|
1309
1517
|
);
|
|
1310
1518
|
}
|
|
1311
1519
|
} else {
|
|
1312
|
-
liquidityMigratorData = this.encodeMigrationData(params.migration
|
|
1520
|
+
liquidityMigratorData = this.encodeMigrationData(params.migration, {
|
|
1521
|
+
numeraire: params.sale.numeraire,
|
|
1522
|
+
overrides: params.modules
|
|
1523
|
+
});
|
|
1313
1524
|
resolvedMigrator = this.getMigratorAddress(
|
|
1314
1525
|
params.migration,
|
|
1315
1526
|
params.modules
|
|
@@ -1570,6 +1781,11 @@ var DopplerFactory = class {
|
|
|
1570
1781
|
}
|
|
1571
1782
|
}
|
|
1572
1783
|
}
|
|
1784
|
+
if (params.migration.type === "dopplerHook") {
|
|
1785
|
+
throw new Error(
|
|
1786
|
+
"dopplerHook migration is only supported for dynamic auctions"
|
|
1787
|
+
);
|
|
1788
|
+
}
|
|
1573
1789
|
if (params.migration.type === "uniswapV4" && params.migration.streamableFees) {
|
|
1574
1790
|
const beneficiaries = params.migration.streamableFees.beneficiaries;
|
|
1575
1791
|
if (beneficiaries.length === 0) {
|
|
@@ -1665,6 +1881,72 @@ var DopplerFactory = class {
|
|
|
1665
1881
|
);
|
|
1666
1882
|
}
|
|
1667
1883
|
}
|
|
1884
|
+
if (params.migration.type === "dopplerHook") {
|
|
1885
|
+
const migration = params.migration;
|
|
1886
|
+
if (!Number.isInteger(migration.fee) || migration.fee < 0) {
|
|
1887
|
+
throw new Error(
|
|
1888
|
+
"DopplerHook migration fee must be a non-negative integer"
|
|
1889
|
+
);
|
|
1890
|
+
}
|
|
1891
|
+
if (migration.fee > 15e4) {
|
|
1892
|
+
throw new Error("DopplerHook migration fee must be <= 150000 (15%)");
|
|
1893
|
+
}
|
|
1894
|
+
if (!Number.isInteger(migration.tickSpacing) || migration.tickSpacing <= 0) {
|
|
1895
|
+
throw new Error(
|
|
1896
|
+
"DopplerHook migration tickSpacing must be a positive integer"
|
|
1897
|
+
);
|
|
1898
|
+
}
|
|
1899
|
+
if (migration.beneficiaries.length === 0) {
|
|
1900
|
+
throw new Error(
|
|
1901
|
+
"At least one beneficiary is required for dopplerHook migration"
|
|
1902
|
+
);
|
|
1903
|
+
}
|
|
1904
|
+
const totalShares = migration.beneficiaries.reduce(
|
|
1905
|
+
(sum, b) => sum + b.shares,
|
|
1906
|
+
0n
|
|
1907
|
+
);
|
|
1908
|
+
if (totalShares !== WAD) {
|
|
1909
|
+
throw new Error(
|
|
1910
|
+
`Beneficiary shares must sum to ${WAD} (100%), but got ${totalShares}`
|
|
1911
|
+
);
|
|
1912
|
+
}
|
|
1913
|
+
const lockDuration = Number(migration.lockDuration);
|
|
1914
|
+
if (!Number.isInteger(lockDuration) || lockDuration < 0) {
|
|
1915
|
+
throw new Error(
|
|
1916
|
+
"DopplerHook migration lockDuration must be a non-negative integer number of seconds"
|
|
1917
|
+
);
|
|
1918
|
+
}
|
|
1919
|
+
if (lockDuration > 4294967295) {
|
|
1920
|
+
throw new Error(
|
|
1921
|
+
"DopplerHook migration lockDuration must fit within uint32"
|
|
1922
|
+
);
|
|
1923
|
+
}
|
|
1924
|
+
if (migration.hook && migration.rehype) {
|
|
1925
|
+
throw new Error(
|
|
1926
|
+
"dopplerHook migration cannot set both hook and rehype config. Use exactly one hook mode."
|
|
1927
|
+
);
|
|
1928
|
+
}
|
|
1929
|
+
if (migration.rehype) {
|
|
1930
|
+
normalizeRehypeDopplerHookMigratorConfig(migration.rehype);
|
|
1931
|
+
}
|
|
1932
|
+
if (migration.proceedsSplit) {
|
|
1933
|
+
if (migration.proceedsSplit.recipient === ZERO_ADDRESS) {
|
|
1934
|
+
throw new Error(
|
|
1935
|
+
"DopplerHook proceeds split recipient cannot be zero address"
|
|
1936
|
+
);
|
|
1937
|
+
}
|
|
1938
|
+
if (migration.proceedsSplit.share < 0n) {
|
|
1939
|
+
throw new Error(
|
|
1940
|
+
"DopplerHook proceeds split share cannot be negative"
|
|
1941
|
+
);
|
|
1942
|
+
}
|
|
1943
|
+
if (migration.proceedsSplit.share > MAX_PROCEEDS_SPLIT_SHARE) {
|
|
1944
|
+
throw new Error(
|
|
1945
|
+
`DopplerHook proceeds split share cannot exceed ${MAX_PROCEEDS_SPLIT_SHARE}`
|
|
1946
|
+
);
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1668
1950
|
}
|
|
1669
1951
|
/**
|
|
1670
1952
|
* Validate multicurve auction parameters
|
|
@@ -1722,6 +2004,11 @@ var DopplerFactory = class {
|
|
|
1722
2004
|
}
|
|
1723
2005
|
}
|
|
1724
2006
|
}
|
|
2007
|
+
if (params.migration.type === "dopplerHook") {
|
|
2008
|
+
throw new Error(
|
|
2009
|
+
"dopplerHook migration is only supported for dynamic auctions"
|
|
2010
|
+
);
|
|
2011
|
+
}
|
|
1725
2012
|
if (params.migration.type === "uniswapV4" && params.migration.streamableFees) {
|
|
1726
2013
|
const beneficiaries = params.migration.streamableFees.beneficiaries;
|
|
1727
2014
|
if (beneficiaries.length === 0) {
|
|
@@ -1781,6 +2068,15 @@ var DopplerFactory = class {
|
|
|
1781
2068
|
}
|
|
1782
2069
|
return v4Address;
|
|
1783
2070
|
}
|
|
2071
|
+
case "dopplerHook": {
|
|
2072
|
+
const dopplerHookMigratorAddress = overrides?.dopplerHookMigrator ?? addresses.dopplerHookMigrator;
|
|
2073
|
+
if (!dopplerHookMigratorAddress || dopplerHookMigratorAddress === ZERO_ADDRESS) {
|
|
2074
|
+
throw new Error(
|
|
2075
|
+
"DopplerHookMigrator not configured on this chain. Provide override via modules.dopplerHookMigrator or use a different migration type."
|
|
2076
|
+
);
|
|
2077
|
+
}
|
|
2078
|
+
return dopplerHookMigratorAddress;
|
|
2079
|
+
}
|
|
1784
2080
|
case "noOp": {
|
|
1785
2081
|
const noOpAddress = overrides?.noOpMigrator ?? addresses.noOpMigrator;
|
|
1786
2082
|
if (!noOpAddress) {
|
|
@@ -2336,14 +2632,18 @@ var DopplerFactory = class {
|
|
|
2336
2632
|
return keccak256(encoded);
|
|
2337
2633
|
}
|
|
2338
2634
|
/**
|
|
2339
|
-
* Compute the V4 poolId for a multicurve pool
|
|
2635
|
+
* Compute the V4 poolId for a multicurve pool from the same pool-key fields
|
|
2636
|
+
* the initializer will register on-chain.
|
|
2340
2637
|
*/
|
|
2341
2638
|
async computeMulticurvePoolId(params, tokenAddress) {
|
|
2342
2639
|
const addresses = getAddresses(this.chainId);
|
|
2343
2640
|
const initializerMode = this.resolveMulticurveInitializerMode(params);
|
|
2344
2641
|
let hookAddress;
|
|
2345
2642
|
if (initializerMode.type === "rehype") {
|
|
2346
|
-
hookAddress =
|
|
2643
|
+
hookAddress = params.modules?.dopplerHookInitializer ?? addresses.dopplerHookInitializer ?? ZERO_ADDRESS;
|
|
2644
|
+
if (hookAddress === ZERO_ADDRESS) {
|
|
2645
|
+
throw new Error("DopplerHookInitializer address not configured");
|
|
2646
|
+
}
|
|
2347
2647
|
} else {
|
|
2348
2648
|
const initializerAddress = (() => {
|
|
2349
2649
|
if (initializerMode.type === "decay") {
|
|
@@ -2366,7 +2666,7 @@ var DopplerFactory = class {
|
|
|
2366
2666
|
const numeraire = params.sale.numeraire;
|
|
2367
2667
|
const currency0 = tokenAddress < numeraire ? tokenAddress : numeraire;
|
|
2368
2668
|
const currency1 = tokenAddress < numeraire ? numeraire : tokenAddress;
|
|
2369
|
-
const fee = initializerMode.type === "decay" ? DYNAMIC_FEE_FLAG : params.pool.fee;
|
|
2669
|
+
const fee = initializerMode.type === "decay" || initializerMode.type === "rehype" && initializerMode.hookConfig ? DYNAMIC_FEE_FLAG : params.pool.fee;
|
|
2370
2670
|
return this.computePoolId({
|
|
2371
2671
|
currency0,
|
|
2372
2672
|
currency1,
|
|
@@ -2401,5 +2701,5 @@ var DopplerFactory = class {
|
|
|
2401
2701
|
var MULTICURVE_BUNDLER_SELECTORS = ["0xe2e9faa1", "0x07087b06"];
|
|
2402
2702
|
|
|
2403
2703
|
export { DopplerFactory };
|
|
2404
|
-
//# sourceMappingURL=chunk-
|
|
2405
|
-
//# sourceMappingURL=chunk-
|
|
2704
|
+
//# sourceMappingURL=chunk-LW3CYA27.mjs.map
|
|
2705
|
+
//# sourceMappingURL=chunk-LW3CYA27.mjs.map
|