@whetstone-research/doppler-sdk 0.0.21 → 0.0.23
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 +94 -0
- package/dist/DopplerSDK.js +25 -24
- package/dist/DopplerSDK.mjs +24 -23
- 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.js +10 -10
- package/dist/abis/index.mjs +5 -5
- package/dist/addresses.d.mts +3 -0
- package/dist/addresses.d.ts +3 -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 +16 -15
- package/dist/builders/DynamicAuctionBuilder.mjs +15 -14
- package/dist/builders/MulticurveBuilder.js +16 -15
- package/dist/builders/MulticurveBuilder.mjs +15 -14
- package/dist/builders/StaticAuctionBuilder.js +16 -15
- package/dist/builders/StaticAuctionBuilder.mjs +15 -14
- package/dist/builders/index.js +24 -23
- package/dist/builders/index.mjs +17 -16
- package/dist/builders/shared.d.mts +1 -1
- package/dist/builders/shared.d.ts +1 -1
- package/dist/builders/shared.js +17 -16
- package/dist/builders/shared.mjs +13 -12
- package/dist/{chunk-AZOBEWP3.mjs → chunk-3NMGCQJ4.mjs} +2 -2
- package/dist/chunk-3NMGCQJ4.mjs.map +1 -0
- package/dist/{chunk-OGYWNJGI.js → chunk-5TQOT6CW.js} +2 -2
- package/dist/chunk-5TQOT6CW.js.map +1 -0
- package/dist/{chunk-GFOBDFVW.js → chunk-6UHDSD42.js} +206 -28
- package/dist/chunk-6UHDSD42.js.map +1 -0
- package/dist/{chunk-JHPDKSC4.js → chunk-7CAAI5DL.js} +115 -84
- package/dist/chunk-7CAAI5DL.js.map +1 -0
- package/dist/{chunk-U7CHPFU6.mjs → chunk-7P2SPZC7.mjs} +189 -11
- package/dist/chunk-7P2SPZC7.mjs.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-SQRQYDB3.mjs → chunk-C6MH7HYT.mjs} +11 -11
- package/dist/{chunk-SQRQYDB3.mjs.map → chunk-C6MH7HYT.mjs.map} +1 -1
- package/dist/{chunk-RJE6LWWF.mjs → chunk-CATH4QRQ.mjs} +3 -3
- package/dist/{chunk-RJE6LWWF.mjs.map → chunk-CATH4QRQ.mjs.map} +1 -1
- package/dist/{chunk-5JQDXMDN.js → chunk-CMNJZKTM.js} +24 -24
- package/dist/{chunk-5JQDXMDN.js.map → chunk-CMNJZKTM.js.map} +1 -1
- package/dist/chunk-DNB3T5P2.js +269 -0
- package/dist/chunk-DNB3T5P2.js.map +1 -0
- package/dist/chunk-DSYPZETD.js +4 -0
- package/dist/{chunk-WTS75RUC.js.map → chunk-DSYPZETD.js.map} +1 -1
- package/dist/{chunk-GLMPU7VL.js → chunk-EH3V2BJF.js} +12 -12
- package/dist/chunk-EH3V2BJF.js.map +1 -0
- package/dist/{chunk-36Y3N257.mjs → chunk-EIXUJANI.mjs} +5 -5
- package/dist/chunk-EIXUJANI.mjs.map +1 -0
- package/dist/{chunk-HX3A6ALC.mjs → chunk-FFV6DMPA.mjs} +3 -3
- package/dist/{chunk-HX3A6ALC.mjs.map → chunk-FFV6DMPA.mjs.map} +1 -1
- package/dist/{chunk-NJYBKWCD.mjs → chunk-FLFYAWSS.mjs} +3 -3
- package/dist/{chunk-NJYBKWCD.mjs.map → chunk-FLFYAWSS.mjs.map} +1 -1
- 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-COUZYFEE.js → chunk-FTRCBE3J.js} +11 -11
- package/dist/{chunk-COUZYFEE.js.map → chunk-FTRCBE3J.js.map} +1 -1
- package/dist/{chunk-HHHCRTC7.js → chunk-FZ4FIWCR.js} +5 -5
- package/dist/{chunk-HHHCRTC7.js.map → chunk-FZ4FIWCR.js.map} +1 -1
- package/dist/chunk-GDODJJ7D.mjs +36 -0
- package/dist/chunk-GDODJJ7D.mjs.map +1 -0
- 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-RKPAL3SU.mjs → chunk-GSTY3GO7.mjs} +3 -3
- package/dist/{chunk-RKPAL3SU.mjs.map → chunk-GSTY3GO7.mjs.map} +1 -1
- package/dist/{chunk-4CJS5XLY.js → chunk-H7WPK5CR.js} +4 -4
- package/dist/{chunk-4CJS5XLY.js.map → chunk-H7WPK5CR.js.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-CXE33IZN.mjs → chunk-HL7ZAAD4.mjs} +19 -7
- package/dist/chunk-HL7ZAAD4.mjs.map +1 -0
- package/dist/{chunk-2ZM4JVFC.js → chunk-J62YDWIK.js} +2 -2
- package/dist/chunk-J62YDWIK.js.map +1 -0
- package/dist/{chunk-TYJZL2XZ.js → chunk-JB5XXPLL.js} +25 -13
- package/dist/chunk-JB5XXPLL.js.map +1 -0
- package/dist/{chunk-WDSV4O6T.mjs → chunk-OHA5KJ2M.mjs} +2 -2
- package/dist/chunk-OHA5KJ2M.mjs.map +1 -0
- package/dist/{chunk-AS5UUJRI.js → chunk-OX5CESVM.js} +13 -11
- package/dist/chunk-OX5CESVM.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-OF7BIKXV.js → chunk-QRTABC4Z.js} +2 -2
- package/dist/chunk-QRTABC4Z.js.map +1 -0
- package/dist/{chunk-XEWKLVOD.mjs → chunk-RI6SDMER.mjs} +3 -3
- package/dist/{chunk-XEWKLVOD.mjs.map → chunk-RI6SDMER.mjs.map} +1 -1
- package/dist/{chunk-NWZGO2CH.mjs → chunk-RIIVW6TQ.mjs} +43 -12
- package/dist/chunk-RIIVW6TQ.mjs.map +1 -0
- package/dist/{chunk-VK5HAWX6.mjs → chunk-SWWLOD7Q.mjs} +2 -2
- package/dist/chunk-SWWLOD7Q.mjs.map +1 -0
- package/dist/{chunk-Y5RAENN5.js → chunk-TIGHBA37.js} +5 -5
- package/dist/{chunk-Y5RAENN5.js.map → chunk-TIGHBA37.js.map} +1 -1
- package/dist/{chunk-BFJGY436.mjs → chunk-TLEVIIUE.mjs} +5 -3
- package/dist/chunk-TLEVIIUE.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-V7YRKFYK.mjs → chunk-VCX6FG3E.mjs} +5 -5
- package/dist/{chunk-V7YRKFYK.mjs.map → chunk-VCX6FG3E.mjs.map} +1 -1
- package/dist/{chunk-64ZQRKG3.mjs → chunk-VYSOAGRU.mjs} +2 -2
- package/dist/chunk-VYSOAGRU.mjs.map +1 -0
- package/dist/chunk-WJBJARLJ.js +38 -0
- package/dist/chunk-WJBJARLJ.js.map +1 -0
- package/dist/{chunk-OROTK4OT.js → chunk-WNUB3UTT.js} +12 -12
- package/dist/chunk-WNUB3UTT.js.map +1 -0
- package/dist/{chunk-SMTHFPBA.js → chunk-XMFOZYNI.js} +2 -2
- package/dist/chunk-XMFOZYNI.js.map +1 -0
- package/dist/chunk-XRYLHTVV.mjs +267 -0
- package/dist/chunk-XRYLHTVV.mjs.map +1 -0
- package/dist/{chunk-K27G7LLT.js → chunk-XT3BAM4H.js} +5 -5
- package/dist/{chunk-K27G7LLT.js.map → chunk-XT3BAM4H.js.map} +1 -1
- package/dist/{chunk-VGCXJRUV.mjs → chunk-YBK6EBA5.mjs} +10 -10
- package/dist/chunk-YBK6EBA5.mjs.map +1 -0
- package/dist/{chunk-545TB6TH.js → chunk-YFEPTSI2.js} +11 -11
- package/dist/{chunk-545TB6TH.js.map → chunk-YFEPTSI2.js.map} +1 -1
- 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 +39 -19
- package/dist/deployments.generated.d.ts +39 -19
- package/dist/deployments.generated.js +2 -2
- package/dist/deployments.generated.mjs +1 -1
- package/dist/entities/DopplerFactory.js +14 -13
- package/dist/entities/DopplerFactory.mjs +13 -12
- package/dist/entities/auction/DynamicAuction.js +9 -9
- package/dist/entities/auction/DynamicAuction.mjs +8 -8
- package/dist/entities/auction/MulticurvePool.js +10 -10
- package/dist/entities/auction/MulticurvePool.mjs +9 -9
- package/dist/entities/auction/StaticAuction.js +9 -9
- package/dist/entities/auction/StaticAuction.mjs +8 -8
- package/dist/entities/auction/index.js +17 -17
- package/dist/entities/auction/index.mjs +11 -11
- package/dist/entities/quoter/Quoter.js +9 -9
- package/dist/entities/quoter/Quoter.mjs +8 -8
- package/dist/entities/quoter/index.js +9 -9
- package/dist/entities/quoter/index.mjs +8 -8
- package/dist/entities/token/derc20/Derc20.js +5 -5
- package/dist/entities/token/derc20/Derc20.mjs +5 -5
- package/dist/entities/token/derc20/index.js +5 -5
- package/dist/entities/token/derc20/index.mjs +5 -5
- package/dist/entities/token/index.js +6 -6
- package/dist/entities/token/index.mjs +6 -6
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +71 -66
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -23
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +33 -5
- package/dist/types.d.ts +33 -5
- 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/dopplerHookMigrator.d.mts +11 -0
- package/dist/utils/dopplerHookMigrator.d.ts +11 -0
- package/dist/utils/dopplerHookMigrator.js +12 -0
- package/dist/utils/dopplerHookMigrator.js.map +1 -0
- package/dist/utils/dopplerHookMigrator.mjs +3 -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 +36 -31
- package/dist/utils/index.mjs +12 -11
- package/dist/utils/marketCapHelpers.js +13 -13
- package/dist/utils/marketCapHelpers.mjs +1 -1
- package/dist/utils/tokenAddressMiner.js +7 -7
- package/dist/utils/tokenAddressMiner.mjs +6 -6
- package/package.json +1 -1
- package/dist/chunk-2ZM4JVFC.js.map +0 -1
- package/dist/chunk-36Y3N257.mjs.map +0 -1
- package/dist/chunk-5TL5V6UX.mjs +0 -3
- package/dist/chunk-64ZQRKG3.mjs.map +0 -1
- package/dist/chunk-AS5UUJRI.js.map +0 -1
- package/dist/chunk-AZOBEWP3.mjs.map +0 -1
- package/dist/chunk-BFJGY436.mjs.map +0 -1
- package/dist/chunk-CXE33IZN.mjs.map +0 -1
- package/dist/chunk-GFOBDFVW.js.map +0 -1
- package/dist/chunk-GLMPU7VL.js.map +0 -1
- package/dist/chunk-JHPDKSC4.js.map +0 -1
- package/dist/chunk-LPA32BIK.mjs.map +0 -1
- package/dist/chunk-NWZGO2CH.mjs.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 +0 -247
- package/dist/chunk-QFQXHDC7.mjs.map +0 -1
- package/dist/chunk-RLUMYHPI.js +0 -249
- package/dist/chunk-RLUMYHPI.js.map +0 -1
- package/dist/chunk-SMTHFPBA.js.map +0 -1
- package/dist/chunk-TYJZL2XZ.js.map +0 -1
- package/dist/chunk-U7CHPFU6.mjs.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-WTS75RUC.js +0 -4
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { computeOptimalGamma } from './chunk-H3B54PFV.mjs';
|
|
2
|
+
import { encodeRehypeDopplerHookMigratorCalldata } from './chunk-GDODJJ7D.mjs';
|
|
2
3
|
import { isToken0Expected } from './chunk-ABT6AT7C.mjs';
|
|
3
4
|
import { MIN_TICK, MAX_TICK } from './chunk-25GEBO3B.mjs';
|
|
4
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, DECAY_MAX_START_FEE, V4_MAX_FEE, WAD, DEFAULT_V3_YEARLY_MINT_RATE, TICK_SPACINGS, DOPPLER_MAX_TICK_SPACING, FLAG_MASK, DYNAMIC_FEE_FLAG } from './chunk-IWJOPXYN.mjs';
|
|
5
|
-
import { getAddresses } from './chunk-
|
|
6
|
+
import { getAddresses } from './chunk-RIIVW6TQ.mjs';
|
|
6
7
|
import { airlockAbi, bundlerAbi, v4MulticurveInitializerAbi } from './chunk-E2NF4AQB.mjs';
|
|
7
|
-
import { derc20_default } from './chunk-
|
|
8
|
-
import { derc2080_default } from './chunk-
|
|
9
|
-
import { doppler_default } from './chunk-
|
|
10
|
-
import { dopplerDN404_default } from './chunk-
|
|
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
|
}
|
|
@@ -1309,7 +1388,10 @@ var DopplerFactory = class {
|
|
|
1309
1388
|
);
|
|
1310
1389
|
}
|
|
1311
1390
|
} else {
|
|
1312
|
-
liquidityMigratorData = this.encodeMigrationData(params.migration
|
|
1391
|
+
liquidityMigratorData = this.encodeMigrationData(params.migration, {
|
|
1392
|
+
numeraire: params.sale.numeraire,
|
|
1393
|
+
overrides: params.modules
|
|
1394
|
+
});
|
|
1313
1395
|
resolvedMigrator = this.getMigratorAddress(
|
|
1314
1396
|
params.migration,
|
|
1315
1397
|
params.modules
|
|
@@ -1570,6 +1652,11 @@ var DopplerFactory = class {
|
|
|
1570
1652
|
}
|
|
1571
1653
|
}
|
|
1572
1654
|
}
|
|
1655
|
+
if (params.migration.type === "dopplerHook") {
|
|
1656
|
+
throw new Error(
|
|
1657
|
+
"dopplerHook migration is only supported for dynamic auctions"
|
|
1658
|
+
);
|
|
1659
|
+
}
|
|
1573
1660
|
if (params.migration.type === "uniswapV4" && params.migration.streamableFees) {
|
|
1574
1661
|
const beneficiaries = params.migration.streamableFees.beneficiaries;
|
|
1575
1662
|
if (beneficiaries.length === 0) {
|
|
@@ -1665,6 +1752,83 @@ var DopplerFactory = class {
|
|
|
1665
1752
|
);
|
|
1666
1753
|
}
|
|
1667
1754
|
}
|
|
1755
|
+
if (params.migration.type === "dopplerHook") {
|
|
1756
|
+
const migration = params.migration;
|
|
1757
|
+
if (!Number.isInteger(migration.fee) || migration.fee < 0) {
|
|
1758
|
+
throw new Error(
|
|
1759
|
+
"DopplerHook migration fee must be a non-negative integer"
|
|
1760
|
+
);
|
|
1761
|
+
}
|
|
1762
|
+
if (migration.fee > 15e4) {
|
|
1763
|
+
throw new Error("DopplerHook migration fee must be <= 150000 (15%)");
|
|
1764
|
+
}
|
|
1765
|
+
if (!Number.isInteger(migration.tickSpacing) || migration.tickSpacing <= 0) {
|
|
1766
|
+
throw new Error(
|
|
1767
|
+
"DopplerHook migration tickSpacing must be a positive integer"
|
|
1768
|
+
);
|
|
1769
|
+
}
|
|
1770
|
+
if (migration.beneficiaries.length === 0) {
|
|
1771
|
+
throw new Error(
|
|
1772
|
+
"At least one beneficiary is required for dopplerHook migration"
|
|
1773
|
+
);
|
|
1774
|
+
}
|
|
1775
|
+
const totalShares = migration.beneficiaries.reduce(
|
|
1776
|
+
(sum, b) => sum + b.shares,
|
|
1777
|
+
0n
|
|
1778
|
+
);
|
|
1779
|
+
if (totalShares !== WAD) {
|
|
1780
|
+
throw new Error(
|
|
1781
|
+
`Beneficiary shares must sum to ${WAD} (100%), but got ${totalShares}`
|
|
1782
|
+
);
|
|
1783
|
+
}
|
|
1784
|
+
const lockDuration = Number(migration.lockDuration);
|
|
1785
|
+
if (!Number.isInteger(lockDuration) || lockDuration < 0) {
|
|
1786
|
+
throw new Error(
|
|
1787
|
+
"DopplerHook migration lockDuration must be a non-negative integer number of seconds"
|
|
1788
|
+
);
|
|
1789
|
+
}
|
|
1790
|
+
if (lockDuration > 4294967295) {
|
|
1791
|
+
throw new Error(
|
|
1792
|
+
"DopplerHook migration lockDuration must fit within uint32"
|
|
1793
|
+
);
|
|
1794
|
+
}
|
|
1795
|
+
if (migration.hook && migration.rehype) {
|
|
1796
|
+
throw new Error(
|
|
1797
|
+
"dopplerHook migration cannot set both hook and rehype config. Use exactly one hook mode."
|
|
1798
|
+
);
|
|
1799
|
+
}
|
|
1800
|
+
if (migration.rehype) {
|
|
1801
|
+
if (!Number.isInteger(migration.rehype.customFee) || migration.rehype.customFee < 0) {
|
|
1802
|
+
throw new Error("Rehype customFee must be a non-negative integer");
|
|
1803
|
+
}
|
|
1804
|
+
if (migration.rehype.customFee > 1e6) {
|
|
1805
|
+
throw new Error("Rehype customFee must be <= 1000000 (100%)");
|
|
1806
|
+
}
|
|
1807
|
+
const rehypeDistributionTotal = migration.rehype.assetBuybackPercentWad + migration.rehype.numeraireBuybackPercentWad + migration.rehype.beneficiaryPercentWad + migration.rehype.lpPercentWad;
|
|
1808
|
+
if (rehypeDistributionTotal !== WAD) {
|
|
1809
|
+
throw new Error(
|
|
1810
|
+
`DopplerHook fee distribution must sum to ${WAD} (100%), but got ${rehypeDistributionTotal}`
|
|
1811
|
+
);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
if (migration.proceedsSplit) {
|
|
1815
|
+
if (migration.proceedsSplit.recipient === ZERO_ADDRESS) {
|
|
1816
|
+
throw new Error(
|
|
1817
|
+
"DopplerHook proceeds split recipient cannot be zero address"
|
|
1818
|
+
);
|
|
1819
|
+
}
|
|
1820
|
+
if (migration.proceedsSplit.share < 0n) {
|
|
1821
|
+
throw new Error(
|
|
1822
|
+
"DopplerHook proceeds split share cannot be negative"
|
|
1823
|
+
);
|
|
1824
|
+
}
|
|
1825
|
+
if (migration.proceedsSplit.share > MAX_PROCEEDS_SPLIT_SHARE) {
|
|
1826
|
+
throw new Error(
|
|
1827
|
+
`DopplerHook proceeds split share cannot exceed ${MAX_PROCEEDS_SPLIT_SHARE}`
|
|
1828
|
+
);
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1668
1832
|
}
|
|
1669
1833
|
/**
|
|
1670
1834
|
* Validate multicurve auction parameters
|
|
@@ -1722,6 +1886,11 @@ var DopplerFactory = class {
|
|
|
1722
1886
|
}
|
|
1723
1887
|
}
|
|
1724
1888
|
}
|
|
1889
|
+
if (params.migration.type === "dopplerHook") {
|
|
1890
|
+
throw new Error(
|
|
1891
|
+
"dopplerHook migration is only supported for dynamic auctions"
|
|
1892
|
+
);
|
|
1893
|
+
}
|
|
1725
1894
|
if (params.migration.type === "uniswapV4" && params.migration.streamableFees) {
|
|
1726
1895
|
const beneficiaries = params.migration.streamableFees.beneficiaries;
|
|
1727
1896
|
if (beneficiaries.length === 0) {
|
|
@@ -1781,6 +1950,15 @@ var DopplerFactory = class {
|
|
|
1781
1950
|
}
|
|
1782
1951
|
return v4Address;
|
|
1783
1952
|
}
|
|
1953
|
+
case "dopplerHook": {
|
|
1954
|
+
const dopplerHookMigratorAddress = overrides?.dopplerHookMigrator ?? addresses.dopplerHookMigrator;
|
|
1955
|
+
if (!dopplerHookMigratorAddress || dopplerHookMigratorAddress === ZERO_ADDRESS) {
|
|
1956
|
+
throw new Error(
|
|
1957
|
+
"DopplerHookMigrator not configured on this chain. Provide override via modules.dopplerHookMigrator or use a different migration type."
|
|
1958
|
+
);
|
|
1959
|
+
}
|
|
1960
|
+
return dopplerHookMigratorAddress;
|
|
1961
|
+
}
|
|
1784
1962
|
case "noOp": {
|
|
1785
1963
|
const noOpAddress = overrides?.noOpMigrator ?? addresses.noOpMigrator;
|
|
1786
1964
|
if (!noOpAddress) {
|
|
@@ -2401,5 +2579,5 @@ var DopplerFactory = class {
|
|
|
2401
2579
|
var MULTICURVE_BUNDLER_SELECTORS = ["0xe2e9faa1", "0x07087b06"];
|
|
2402
2580
|
|
|
2403
2581
|
export { DopplerFactory };
|
|
2404
|
-
//# sourceMappingURL=chunk-
|
|
2405
|
-
//# sourceMappingURL=chunk-
|
|
2582
|
+
//# sourceMappingURL=chunk-7P2SPZC7.mjs.map
|
|
2583
|
+
//# sourceMappingURL=chunk-7P2SPZC7.mjs.map
|