@whetstone-research/doppler-sdk 1.0.36 → 1.0.38
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 +37 -43
- package/dist/evm/index.cjs +1359 -665
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +679 -280
- package/dist/evm/index.d.ts +679 -280
- package/dist/evm/index.js +1360 -667
- package/dist/evm/index.js.map +1 -1
- package/dist/solana/index.cjs +433 -25
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +204 -32
- package/dist/solana/index.d.ts +204 -32
- package/dist/solana/index.js +434 -26
- package/dist/solana/index.js.map +1 -1
- package/package.json +2 -2
package/dist/evm/index.cjs
CHANGED
|
@@ -7,6 +7,7 @@ var viem = require('viem');
|
|
|
7
7
|
var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
8
8
|
"1": {
|
|
9
9
|
Airlock: "0xDe3599a2eC440B296373a983C85C365DA55d9dFA",
|
|
10
|
+
Bundler: "0xf45588E8e0B1df9dB9ae7E20eCE5726AE931357c",
|
|
10
11
|
DopplerCreateXDeployer: "0x103004E50Bed65DFBa30dD9c264B6BdF5e529B83",
|
|
11
12
|
DopplerDeployer: "0xb35469ee64A87Afd19B31615094fE3962d73e421",
|
|
12
13
|
DopplerERC20V1: "0xDB7B520bb5C3a2C5d4871198081911359f93be87",
|
|
@@ -18,9 +19,9 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
18
19
|
LockableUniswapV3Initializer: "0xA2E0435225D52a8B950122752978007D758056d7",
|
|
19
20
|
NoOpGovernanceFactory: "0xddAE8B3eD08184682f7Bc32B74d943cEEfEab638",
|
|
20
21
|
NoOpMigrator: "0x233A71A7bB928b1357A1Ebf454298320989Ca5B5",
|
|
21
|
-
Quoter: "
|
|
22
|
-
RehypeDopplerHookInitializer: "
|
|
23
|
-
RehypeDopplerHookMigrator: "
|
|
22
|
+
Quoter: "0xce6cd4E35447E05A39A50A4bCf61f2DcD93A8f0D",
|
|
23
|
+
RehypeDopplerHookInitializer: "0x5F9eB5f6726Fe88D5e39867967F5b833d2fA3215",
|
|
24
|
+
RehypeDopplerHookMigrator: "0x660740D7d6Fb2C8998Fa3ffF459cceB9Ac12C84B",
|
|
24
25
|
StreamableFeesLockerV2: "0xcE3212e6536F33cD6fbFEE265224131353Ca3D47",
|
|
25
26
|
TimelockFactory: "0x9fd40af2baAfAF03513f091444e821c0d5b06ea0",
|
|
26
27
|
TopUpDistributor: "0x435312320C0330B1999746753551CdFbD83aD814",
|
|
@@ -30,7 +31,7 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
30
31
|
},
|
|
31
32
|
"143": {
|
|
32
33
|
Airlock: "0x660eAaEdEBc968f8f3694354FA8EC0b4c5Ba8D12",
|
|
33
|
-
Bundler: "
|
|
34
|
+
Bundler: "0xf45588E8e0B1df9dB9ae7E20eCE5726AE931357c",
|
|
34
35
|
DopplerCreateXDeployer: "0x103004E50Bed65DFBa30dD9c264B6BdF5e529B83",
|
|
35
36
|
DopplerDeployer: "0xb35469ee64A87Afd19B31615094fE3962d73e421",
|
|
36
37
|
DopplerERC20V1: "0xDB7B520bb5C3a2C5d4871198081911359f93be87",
|
|
@@ -42,9 +43,9 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
42
43
|
LockableUniswapV3Initializer: "0x8b4C7DB9121FC885689C0A50D5a1429F15AEc2a0",
|
|
43
44
|
NoOpGovernanceFactory: "0xb4deE32EB70A5E55f3D2d861F49Fb3D79f7a14d9",
|
|
44
45
|
NoOpMigrator: "0x5F3bA43D44375286296Cb85F1EA2EBfa25dde731",
|
|
45
|
-
Quoter: "
|
|
46
|
-
RehypeDopplerHookInitializer: "
|
|
47
|
-
RehypeDopplerHookMigrator: "
|
|
46
|
+
Quoter: "0xce6cd4E35447E05A39A50A4bCf61f2DcD93A8f0D",
|
|
47
|
+
RehypeDopplerHookInitializer: "0x5F9eB5f6726Fe88D5e39867967F5b833d2fA3215",
|
|
48
|
+
RehypeDopplerHookMigrator: "0x660740D7d6Fb2C8998Fa3ffF459cceB9Ac12C84B",
|
|
48
49
|
StreamableFeesLockerV2: "0xcE3212e6536F33cD6fbFEE265224131353Ca3D47",
|
|
49
50
|
TimelockFactory: "0x44610355465c1F5914C8B8ea0E7c887CC67459b2",
|
|
50
51
|
TopUpDistributor: "0x435312320C0330B1999746753551CdFbD83aD814",
|
|
@@ -54,7 +55,7 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
54
55
|
},
|
|
55
56
|
"4663": {
|
|
56
57
|
Airlock: "0xeb7C034704eF8Dcd2D32324c1545f62fB4aD0862",
|
|
57
|
-
Bundler: "
|
|
58
|
+
Bundler: "0xf45588E8e0B1df9dB9ae7E20eCE5726AE931357c",
|
|
58
59
|
DN404Factory: "0x37A9Fa204a4d3A429FDED7e3469ab076C854Bc9d",
|
|
59
60
|
DopplerCreateXDeployer: "0x103004E50Bed65DFBa30dD9c264B6BdF5e529B83",
|
|
60
61
|
DopplerDeployer: "0x4389AD34938B14F25cff7ED983c53f5a42A2573f",
|
|
@@ -68,9 +69,9 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
68
69
|
LockableUniswapV3Initializer: "0xde8886A0019Ea060B8378Ee37b8A23b8117F29A3",
|
|
69
70
|
NoOpGovernanceFactory: "0x85f37f74Ef2478A770318bc810177a9835911aD7",
|
|
70
71
|
NoOpMigrator: "0xba2F330EDb16cD8056f5988d8CE19BbC63475A0e",
|
|
71
|
-
Quoter: "
|
|
72
|
-
RehypeDopplerHookInitializer: "
|
|
73
|
-
RehypeDopplerHookMigrator: "
|
|
72
|
+
Quoter: "0xce6cd4E35447E05A39A50A4bCf61f2DcD93A8f0D",
|
|
73
|
+
RehypeDopplerHookInitializer: "0x5F9eB5f6726Fe88D5e39867967F5b833d2fA3215",
|
|
74
|
+
RehypeDopplerHookMigrator: "0x660740D7d6Fb2C8998Fa3ffF459cceB9Ac12C84B",
|
|
74
75
|
StreamableFeesLockerV2: "0x7B6147AC3F615bdb764e7EbD5f517dac1AD163B8",
|
|
75
76
|
SwapRestrictorDopplerHook: "0xC16c826F75338A5Ea626f94f8992191B4ce5abA2",
|
|
76
77
|
TimelockFactory: "0x6076fdDFCaC0dD980e0350dfF5239feC3f86C578",
|
|
@@ -81,7 +82,7 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
81
82
|
},
|
|
82
83
|
"8453": {
|
|
83
84
|
Airlock: "0x660eAaEdEBc968f8f3694354FA8EC0b4c5Ba8D12",
|
|
84
|
-
Bundler: "
|
|
85
|
+
Bundler: "0xf45588E8e0B1df9dB9ae7E20eCE5726AE931357c",
|
|
85
86
|
DN404Factory: "0x37A9Fa204a4d3A429FDED7e3469ab076C854Bc9d",
|
|
86
87
|
DopplerCreateXDeployer: "0x103004E50Bed65DFBa30dD9c264B6BdF5e529B83",
|
|
87
88
|
DopplerDeployer: "0xb35469ee64A87Afd19B31615094fE3962d73e421",
|
|
@@ -95,9 +96,9 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
95
96
|
LockableUniswapV3Initializer: "0xE0dC4012AC9C868F09c6e4b20d66ED46D6F258d0",
|
|
96
97
|
NoOpGovernanceFactory: "0xe7dfbd5b0A2C3B4464653A9beCdc489229eF090E",
|
|
97
98
|
NoOpMigrator: "0x6ddfED58D238Ca3195E49d8ac3d4cEa6386E5C33",
|
|
98
|
-
Quoter: "
|
|
99
|
-
RehypeDopplerHookInitializer: "
|
|
100
|
-
RehypeDopplerHookMigrator: "
|
|
99
|
+
Quoter: "0xce6cd4E35447E05A39A50A4bCf61f2DcD93A8f0D",
|
|
100
|
+
RehypeDopplerHookInitializer: "0x5F9eB5f6726Fe88D5e39867967F5b833d2fA3215",
|
|
101
|
+
RehypeDopplerHookMigrator: "0x660740D7d6Fb2C8998Fa3ffF459cceB9Ac12C84B",
|
|
101
102
|
StreamableFeesLockerV2: "0xcE3212e6536F33cD6fbFEE265224131353Ca3D47",
|
|
102
103
|
TimelockFactory: "0xa636bD5F9179E80e9EdB371Ed90956fA5ebdCB33",
|
|
103
104
|
TopUpDistributor: "0x435312320C0330B1999746753551CdFbD83aD814",
|
|
@@ -105,10 +106,37 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
105
106
|
UniswapV2MigratorSplit: "0xD7abA5f1d80a330a6fe9E96F7bA122710E0912d3",
|
|
106
107
|
UniswapV4Initializer: "0x53b4c21a6Cb61D64F636ABBfa6E8E90E6558e8ad"
|
|
107
108
|
},
|
|
109
|
+
"42161": {
|
|
110
|
+
Airlock: "0xeb7C034704eF8Dcd2D32324c1545f62fB4aD0862",
|
|
111
|
+
Bundler: "0xf45588E8e0B1df9dB9ae7E20eCE5726AE931357c",
|
|
112
|
+
DN404Factory: "0x37A9Fa204a4d3A429FDED7e3469ab076C854Bc9d",
|
|
113
|
+
DopplerCreateXDeployer: "0x103004E50Bed65DFBa30dD9c264B6BdF5e529B83",
|
|
114
|
+
DopplerDeployer: "0x4389AD34938B14F25cff7ED983c53f5a42A2573f",
|
|
115
|
+
DopplerERC20V1: "0x3Be8B97Fd0e713B5aBE0649Fa830223B6B4BC599",
|
|
116
|
+
DopplerERC20V1Factory: "0x1B37D3a72082029c44B35B604Ea473617580b69a",
|
|
117
|
+
DopplerHookInitializer: "0xAa7f809BB3752f715fA2e418230667C382A56544",
|
|
118
|
+
DopplerHookMigrator: "0x7BF319d8e969f7596B1Bc171Da9ce322f67Ae0c4",
|
|
119
|
+
DopplerLensQuoter: "0xf4c22465532f64777FfcD7770831AEca38F35c04",
|
|
120
|
+
GovernanceFactory: "0xDeb0447DAE3EB177c4dbA8bBCCCa25c8F273B7ef",
|
|
121
|
+
LaunchpadGovernanceFactory: "0xdb036746D65DD52126b1915f1AdF555e6C5237Cf",
|
|
122
|
+
LockableUniswapV3Initializer: "0xde8886A0019Ea060B8378Ee37b8A23b8117F29A3",
|
|
123
|
+
NoOpGovernanceFactory: "0x85f37f74Ef2478A770318bc810177a9835911aD7",
|
|
124
|
+
NoOpMigrator: "0xba2F330EDb16cD8056f5988d8CE19BbC63475A0e",
|
|
125
|
+
Quoter: "0xc9Be59b344Ec66547A4C697aa374e959D59b0567",
|
|
126
|
+
RehypeDopplerHookInitializer: "0x5F9eB5f6726Fe88D5e39867967F5b833d2fA3215",
|
|
127
|
+
RehypeDopplerHookMigrator: "0x660740D7d6Fb2C8998Fa3ffF459cceB9Ac12C84B",
|
|
128
|
+
StreamableFeesLockerV2: "0xEd822828B6109d16a9D362b8146a35789E0064f5",
|
|
129
|
+
SwapRestrictorDopplerHook: "0xC16c826F75338A5Ea626f94f8992191B4ce5abA2",
|
|
130
|
+
TimelockFactory: "0x6076fdDFCaC0dD980e0350dfF5239feC3f86C578",
|
|
131
|
+
TopUpDistributor: "0x46adee7595d48b1Ec53090e9bc78e1E69Fa0eF06",
|
|
132
|
+
UniswapV2Locker: "0x63f6Efe03F25A8C6650b38d05C5a454051d642a5",
|
|
133
|
+
UniswapV2MigratorSplit: "0xB05046cEa797c993FB5b583098B1c4682e9Da333",
|
|
134
|
+
UniswapV4Initializer: "0x6cce158B6D1747617fc218592B4D60B239B957ea"
|
|
135
|
+
},
|
|
108
136
|
"84532": {
|
|
109
137
|
Airlock: "0x3411306Ce66c9469BFF1535BA955503c4Bde1C6e",
|
|
110
138
|
AirlockMultisigTestnet: "0x0abCf819FD57C9f0141628410fFC273405E44426",
|
|
111
|
-
Bundler: "
|
|
139
|
+
Bundler: "0xDdDDDd67579B73fDdFf301DB92Fd4A01afD4613a",
|
|
112
140
|
DN404Factory: "0x98b0Aa2e0f134dbB3eb157b5646D387E6D55243a",
|
|
113
141
|
DopplerCreateXDeployer: "0x0000000000f13Ab5b685F03A412A26719aB6bE60",
|
|
114
142
|
DopplerDeployer: "0xb35469ee64A87Afd19B31615094fE3962d73e421",
|
|
@@ -122,9 +150,9 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
122
150
|
LockableUniswapV3Initializer: "0x16AdA5Be50C3c2D94Af5fEae6b539C40A78Ad53c",
|
|
123
151
|
NoOpGovernanceFactory: "0x7bD798fafC99A3b17E261F8308A8C11B56935ea1",
|
|
124
152
|
NoOpMigrator: "0xF11066abbd329ac4bBA39455340539322C222eb0",
|
|
125
|
-
Quoter: "
|
|
126
|
-
RehypeDopplerHookInitializer: "
|
|
127
|
-
RehypeDopplerHookMigrator: "
|
|
153
|
+
Quoter: "0xc20347a97646ed6e2B45DBfEcE372f68d928ec0a",
|
|
154
|
+
RehypeDopplerHookInitializer: "0xAdB90eF4dc001CFB81ecADEd2CDbda7D18487606",
|
|
155
|
+
RehypeDopplerHookMigrator: "0x5E2A91F8eBE288e0AA76a0C1A47877Ded801e90d",
|
|
128
156
|
StreamableFeesLockerV2: "0xcE3212e6536F33cD6fbFEE265224131353Ca3D47",
|
|
129
157
|
TimelockFactory: "0x80F42ECCc91177D39E20f1A88A54D231c1b086a2",
|
|
130
158
|
TopUpDistributor: "0x435312320C0330B1999746753551CdFbD83aD814",
|
|
@@ -136,6 +164,8 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
|
|
|
136
164
|
var WAD = 10n ** 18n;
|
|
137
165
|
var DEAD_ADDRESS = "0x000000000000000000000000000000000000dEaD";
|
|
138
166
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
167
|
+
var MAX_UINT64 = (1n << 64n) - 1n;
|
|
168
|
+
var MAX_UINT128 = (1n << 128n) - 1n;
|
|
139
169
|
var FEE_TIERS = {
|
|
140
170
|
LOWEST: 100,
|
|
141
171
|
// 0.01%
|
|
@@ -164,6 +194,7 @@ var TICK_SPACINGS = {
|
|
|
164
194
|
var DOPPLER_MAX_TICK_SPACING = 30;
|
|
165
195
|
var SECONDS_PER_DAY = 86400;
|
|
166
196
|
var SECONDS_PER_YEAR = 365 * SECONDS_PER_DAY;
|
|
197
|
+
var MIN_BUNDLER_VESTING_DURATION = BigInt(SECONDS_PER_DAY);
|
|
167
198
|
var DEFAULT_EPOCH_LENGTH = 43200;
|
|
168
199
|
var DEFAULT_AUCTION_DURATION = 7 * SECONDS_PER_DAY;
|
|
169
200
|
var DEFAULT_LOCK_DURATION = SECONDS_PER_YEAR;
|
|
@@ -258,6 +289,7 @@ var FEE_AMOUNT_MASK = 16777215;
|
|
|
258
289
|
var CHAIN_IDS = {
|
|
259
290
|
MAINNET: 1,
|
|
260
291
|
ETH_SEPOLIA: 11155111,
|
|
292
|
+
ARBITRUM: 42161,
|
|
261
293
|
BASE: 8453,
|
|
262
294
|
BASE_SEPOLIA: 84532,
|
|
263
295
|
INK: 57073,
|
|
@@ -322,6 +354,7 @@ var ADDRESSES = {
|
|
|
322
354
|
topUpDistributor: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.MAINNET].TopUpDistributor,
|
|
323
355
|
universalRouter: "0x66a9893cc07d91d95644aedd05d03f95e1dba8af",
|
|
324
356
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
357
|
+
bundler: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.MAINNET].Bundler,
|
|
325
358
|
weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
326
359
|
univ2Router02: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
|
|
327
360
|
uniswapV2Factory: "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
|
|
@@ -356,6 +389,55 @@ var ADDRESSES = {
|
|
|
356
389
|
weth: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
|
|
357
390
|
uniswapV4Quoter: "0x61b3f2011a92d183c7dbadbda940a7555ccf9227"
|
|
358
391
|
},
|
|
392
|
+
[CHAIN_IDS.ARBITRUM]: {
|
|
393
|
+
airlock: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].Airlock,
|
|
394
|
+
tokenFactory: ZERO_ADDRESS,
|
|
395
|
+
dopplerERC20V1Factory: getGeneratedAddress(
|
|
396
|
+
CHAIN_IDS.ARBITRUM,
|
|
397
|
+
"DopplerERC20V1Factory"
|
|
398
|
+
),
|
|
399
|
+
dopplerERC20V1Implementation: getGeneratedAddress(
|
|
400
|
+
CHAIN_IDS.ARBITRUM,
|
|
401
|
+
"DopplerERC20V1"
|
|
402
|
+
),
|
|
403
|
+
doppler404Factory: getGeneratedAddress(CHAIN_IDS.ARBITRUM, "DN404Factory"),
|
|
404
|
+
v3Initializer: ZERO_ADDRESS,
|
|
405
|
+
v3Quoter: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
|
|
406
|
+
lockableV3Initializer: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].LockableUniswapV3Initializer,
|
|
407
|
+
v4Initializer: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].UniswapV4Initializer,
|
|
408
|
+
dopplerHookInitializer: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].DopplerHookInitializer,
|
|
409
|
+
rehypeDopplerHookInitializer: getRehypeDopplerHookInitializerAddress(
|
|
410
|
+
CHAIN_IDS.ARBITRUM
|
|
411
|
+
),
|
|
412
|
+
rehypeDopplerHook: getRehypeDopplerHookInitializerAddress(
|
|
413
|
+
CHAIN_IDS.ARBITRUM
|
|
414
|
+
),
|
|
415
|
+
dopplerLens: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].DopplerLensQuoter,
|
|
416
|
+
dopplerDeployer: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].DopplerDeployer,
|
|
417
|
+
poolManager: "0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32",
|
|
418
|
+
v2Migrator: ZERO_ADDRESS,
|
|
419
|
+
v2MigratorSplit: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].UniswapV2MigratorSplit,
|
|
420
|
+
v4Migrator: ZERO_ADDRESS,
|
|
421
|
+
dopplerHookMigrator: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].DopplerHookMigrator,
|
|
422
|
+
rehypeDopplerHookMigrator: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].RehypeDopplerHookMigrator,
|
|
423
|
+
noOpMigrator: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].NoOpMigrator,
|
|
424
|
+
governanceFactory: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].GovernanceFactory,
|
|
425
|
+
noOpGovernanceFactory: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].NoOpGovernanceFactory,
|
|
426
|
+
launchpadGovernanceFactory: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].LaunchpadGovernanceFactory,
|
|
427
|
+
streamableFeesLocker: ZERO_ADDRESS,
|
|
428
|
+
streamableFeesLockerV2: getGeneratedAddress(
|
|
429
|
+
CHAIN_IDS.ARBITRUM,
|
|
430
|
+
"StreamableFeesLockerV2"
|
|
431
|
+
),
|
|
432
|
+
topUpDistributor: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].TopUpDistributor,
|
|
433
|
+
universalRouter: "0xA51afAFe0263b40EdaEf0Df8781eA9aa03E381a3",
|
|
434
|
+
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
435
|
+
bundler: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.ARBITRUM].Bundler,
|
|
436
|
+
weth: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
437
|
+
uniswapV2Factory: "0xf1D7CC64Fb4452F05c498126312eBE29f30Fbcf9",
|
|
438
|
+
uniswapV3Factory: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
|
|
439
|
+
uniswapV4Quoter: "0x3972C00f7ed4885e145823eb7C655375d275A1C5"
|
|
440
|
+
},
|
|
359
441
|
[CHAIN_IDS.BASE]: {
|
|
360
442
|
airlock: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.BASE].Airlock,
|
|
361
443
|
tokenFactory: "0xf0B5141dD9096254B2ca624dff26024f46087229",
|
|
@@ -506,7 +588,6 @@ var ADDRESSES = {
|
|
|
506
588
|
universalRouter: "0x112908dac86e20e7241b0927479ea3bf935d1fa0",
|
|
507
589
|
univ2Router02: "0xB3FB126ACDd5AdCA2f50Ac644a7a2303745f18b4",
|
|
508
590
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
509
|
-
bundler: "0x136191B46478cAB023cbC01a36160C4Aad81677a",
|
|
510
591
|
weth: "0x4200000000000000000000000000000000000006",
|
|
511
592
|
uniswapV4Quoter: "0x3972c00f7ed4885e145823eb7c655375d275a1c5"
|
|
512
593
|
},
|
|
@@ -587,7 +668,6 @@ var ADDRESSES = {
|
|
|
587
668
|
univ2Router02: "0x284f11109359a7e1306c3e447ef14d38400063ff",
|
|
588
669
|
uniswapV2Factory: "0x1f98400000000000000000000000000000000002",
|
|
589
670
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
590
|
-
bundler: "0x91231cDdD8d6C86Df602070a3081478e074b97b7",
|
|
591
671
|
weth: "0x4200000000000000000000000000000000000006",
|
|
592
672
|
uniswapV4Quoter: "0x333e3c607b141b18ff6de9f258db6e77fe7491e0"
|
|
593
673
|
},
|
|
@@ -618,7 +698,6 @@ var ADDRESSES = {
|
|
|
618
698
|
universalRouter: "0xf70536B3bcC1bD1a972dc186A2cf84cC6da6Be5D",
|
|
619
699
|
univ2Router02: "0x284f11109359a7e1306c3e447ef14d38400063ff",
|
|
620
700
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
621
|
-
bundler: "0x63f8C8F9beFaab2FaCD7Ece0b0242f78B920Ee90",
|
|
622
701
|
weth: "0x4200000000000000000000000000000000000006",
|
|
623
702
|
uniswapV4Quoter: "0x56dcd40a3f2d466f48e7f48bdbe5cc9b92ae4472"
|
|
624
703
|
},
|
|
@@ -649,7 +728,6 @@ var ADDRESSES = {
|
|
|
649
728
|
universalRouter: ZERO_ADDRESS,
|
|
650
729
|
univ2Router02: ZERO_ADDRESS,
|
|
651
730
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
652
|
-
bundler: "0xf6023127f6E937091D5B605680056A6D27524bad",
|
|
653
731
|
weth: ZERO_ADDRESS,
|
|
654
732
|
// TODO: Get Monad Testnet weth
|
|
655
733
|
uniswapV4Quoter: ZERO_ADDRESS
|
|
@@ -5530,7 +5608,102 @@ var dopplerLensAbi = [
|
|
|
5530
5608
|
stateMutability: "nonpayable"
|
|
5531
5609
|
}
|
|
5532
5610
|
];
|
|
5611
|
+
var bundlerCreateParamsComponents = [
|
|
5612
|
+
{ name: "initialSupply", type: "uint256", internalType: "uint256" },
|
|
5613
|
+
{ name: "numTokensToSell", type: "uint256", internalType: "uint256" },
|
|
5614
|
+
{ name: "numeraire", type: "address", internalType: "address" },
|
|
5615
|
+
{
|
|
5616
|
+
name: "tokenFactory",
|
|
5617
|
+
type: "address",
|
|
5618
|
+
internalType: "contract ITokenFactory"
|
|
5619
|
+
},
|
|
5620
|
+
{ name: "tokenFactoryData", type: "bytes", internalType: "bytes" },
|
|
5621
|
+
{
|
|
5622
|
+
name: "governanceFactory",
|
|
5623
|
+
type: "address",
|
|
5624
|
+
internalType: "contract IGovernanceFactory"
|
|
5625
|
+
},
|
|
5626
|
+
{
|
|
5627
|
+
name: "governanceFactoryData",
|
|
5628
|
+
type: "bytes",
|
|
5629
|
+
internalType: "bytes"
|
|
5630
|
+
},
|
|
5631
|
+
{
|
|
5632
|
+
name: "poolInitializer",
|
|
5633
|
+
type: "address",
|
|
5634
|
+
internalType: "contract IPoolInitializer"
|
|
5635
|
+
},
|
|
5636
|
+
{ name: "poolInitializerData", type: "bytes", internalType: "bytes" },
|
|
5637
|
+
{
|
|
5638
|
+
name: "liquidityMigrator",
|
|
5639
|
+
type: "address",
|
|
5640
|
+
internalType: "contract ILiquidityMigrator"
|
|
5641
|
+
},
|
|
5642
|
+
{
|
|
5643
|
+
name: "liquidityMigratorData",
|
|
5644
|
+
type: "bytes",
|
|
5645
|
+
internalType: "bytes"
|
|
5646
|
+
},
|
|
5647
|
+
{ name: "integrator", type: "address", internalType: "address" },
|
|
5648
|
+
{ name: "salt", type: "bytes32", internalType: "bytes32" }
|
|
5649
|
+
];
|
|
5650
|
+
var bundlerPoolKeyComponents = [
|
|
5651
|
+
{ name: "currency0", type: "address", internalType: "Currency" },
|
|
5652
|
+
{ name: "currency1", type: "address", internalType: "Currency" },
|
|
5653
|
+
{ name: "fee", type: "uint24", internalType: "uint24" },
|
|
5654
|
+
{ name: "tickSpacing", type: "int24", internalType: "int24" },
|
|
5655
|
+
{ name: "hooks", type: "address", internalType: "contract IHooks" }
|
|
5656
|
+
];
|
|
5533
5657
|
var bundlerAbi = [
|
|
5658
|
+
{
|
|
5659
|
+
type: "function",
|
|
5660
|
+
name: "airlock",
|
|
5661
|
+
inputs: [],
|
|
5662
|
+
outputs: [{ name: "", type: "address", internalType: "contract Airlock" }],
|
|
5663
|
+
stateMutability: "view"
|
|
5664
|
+
},
|
|
5665
|
+
{
|
|
5666
|
+
type: "function",
|
|
5667
|
+
name: "poolManager",
|
|
5668
|
+
inputs: [],
|
|
5669
|
+
outputs: [
|
|
5670
|
+
{
|
|
5671
|
+
name: "",
|
|
5672
|
+
type: "address",
|
|
5673
|
+
internalType: "contract IPoolManager"
|
|
5674
|
+
}
|
|
5675
|
+
],
|
|
5676
|
+
stateMutability: "view"
|
|
5677
|
+
},
|
|
5678
|
+
{
|
|
5679
|
+
type: "function",
|
|
5680
|
+
name: "vestingOf",
|
|
5681
|
+
inputs: [{ name: "asset", type: "address", internalType: "address" }],
|
|
5682
|
+
outputs: [
|
|
5683
|
+
{ name: "recipient", type: "address", internalType: "address" },
|
|
5684
|
+
{ name: "permissionlessClaim", type: "bool", internalType: "bool" },
|
|
5685
|
+
{ name: "start", type: "uint64", internalType: "uint64" },
|
|
5686
|
+
{ name: "cliffDuration", type: "uint64", internalType: "uint64" },
|
|
5687
|
+
{ name: "vestingDuration", type: "uint64", internalType: "uint64" },
|
|
5688
|
+
{ name: "totalAmount", type: "uint128", internalType: "uint128" },
|
|
5689
|
+
{ name: "claimedAmount", type: "uint128", internalType: "uint128" }
|
|
5690
|
+
],
|
|
5691
|
+
stateMutability: "view"
|
|
5692
|
+
},
|
|
5693
|
+
{
|
|
5694
|
+
type: "function",
|
|
5695
|
+
name: "claimable",
|
|
5696
|
+
inputs: [{ name: "asset", type: "address", internalType: "address" }],
|
|
5697
|
+
outputs: [{ name: "amount", type: "uint256", internalType: "uint256" }],
|
|
5698
|
+
stateMutability: "view"
|
|
5699
|
+
},
|
|
5700
|
+
{
|
|
5701
|
+
type: "function",
|
|
5702
|
+
name: "claim",
|
|
5703
|
+
inputs: [{ name: "asset", type: "address", internalType: "address" }],
|
|
5704
|
+
outputs: [{ name: "amount", type: "uint256", internalType: "uint256" }],
|
|
5705
|
+
stateMutability: "nonpayable"
|
|
5706
|
+
},
|
|
5534
5707
|
{
|
|
5535
5708
|
type: "function",
|
|
5536
5709
|
name: "bundle",
|
|
@@ -5539,331 +5712,246 @@ var bundlerAbi = [
|
|
|
5539
5712
|
name: "createData",
|
|
5540
5713
|
type: "tuple",
|
|
5541
5714
|
internalType: "struct CreateParams",
|
|
5715
|
+
components: bundlerCreateParamsComponents
|
|
5716
|
+
},
|
|
5717
|
+
{
|
|
5718
|
+
name: "vestingData",
|
|
5719
|
+
type: "tuple",
|
|
5720
|
+
internalType: "struct Bundler.VestingParams",
|
|
5542
5721
|
components: [
|
|
5543
|
-
{ name: "initialSupply", type: "uint256", internalType: "uint256" },
|
|
5544
|
-
{ name: "numTokensToSell", type: "uint256", internalType: "uint256" },
|
|
5545
|
-
{ name: "numeraire", type: "address", internalType: "address" },
|
|
5546
|
-
{
|
|
5547
|
-
name: "tokenFactory",
|
|
5548
|
-
type: "address",
|
|
5549
|
-
internalType: "contract ITokenFactory"
|
|
5550
|
-
},
|
|
5551
|
-
{ name: "tokenFactoryData", type: "bytes", internalType: "bytes" },
|
|
5552
|
-
{
|
|
5553
|
-
name: "governanceFactory",
|
|
5554
|
-
type: "address",
|
|
5555
|
-
internalType: "contract IGovernanceFactory"
|
|
5556
|
-
},
|
|
5557
|
-
{
|
|
5558
|
-
name: "governanceFactoryData",
|
|
5559
|
-
type: "bytes",
|
|
5560
|
-
internalType: "bytes"
|
|
5561
|
-
},
|
|
5562
5722
|
{
|
|
5563
|
-
name: "
|
|
5564
|
-
type: "
|
|
5565
|
-
internalType: "
|
|
5723
|
+
name: "permissionlessClaim",
|
|
5724
|
+
type: "bool",
|
|
5725
|
+
internalType: "bool"
|
|
5566
5726
|
},
|
|
5567
|
-
{ name: "poolInitializerData", type: "bytes", internalType: "bytes" },
|
|
5568
5727
|
{
|
|
5569
|
-
name: "
|
|
5570
|
-
type: "
|
|
5571
|
-
internalType: "
|
|
5728
|
+
name: "vestingDuration",
|
|
5729
|
+
type: "uint64",
|
|
5730
|
+
internalType: "uint64"
|
|
5572
5731
|
},
|
|
5573
5732
|
{
|
|
5574
|
-
name: "
|
|
5575
|
-
type: "
|
|
5576
|
-
internalType: "
|
|
5577
|
-
}
|
|
5578
|
-
{ name: "integrator", type: "address", internalType: "address" },
|
|
5579
|
-
{ name: "salt", type: "bytes32", internalType: "bytes32" }
|
|
5733
|
+
name: "cliffDuration",
|
|
5734
|
+
type: "uint64",
|
|
5735
|
+
internalType: "uint64"
|
|
5736
|
+
}
|
|
5580
5737
|
]
|
|
5581
5738
|
},
|
|
5582
|
-
{ name: "
|
|
5583
|
-
{ name: "
|
|
5739
|
+
{ name: "exactAmountIn", type: "uint128", internalType: "uint128" },
|
|
5740
|
+
{ name: "recipient", type: "address", internalType: "address" }
|
|
5741
|
+
],
|
|
5742
|
+
outputs: [
|
|
5743
|
+
{ name: "asset", type: "address", internalType: "address" },
|
|
5744
|
+
{
|
|
5745
|
+
name: "poolKey",
|
|
5746
|
+
type: "tuple",
|
|
5747
|
+
internalType: "struct PoolKey",
|
|
5748
|
+
components: bundlerPoolKeyComponents
|
|
5749
|
+
},
|
|
5750
|
+
{ name: "governance", type: "address", internalType: "address" },
|
|
5751
|
+
{ name: "timelock", type: "address", internalType: "address" },
|
|
5752
|
+
{ name: "amountOut", type: "uint128", internalType: "uint128" }
|
|
5584
5753
|
],
|
|
5585
|
-
outputs: [],
|
|
5586
5754
|
stateMutability: "payable"
|
|
5587
5755
|
},
|
|
5588
5756
|
{
|
|
5589
5757
|
type: "function",
|
|
5590
|
-
name: "
|
|
5758
|
+
name: "simulateBundle",
|
|
5591
5759
|
inputs: [
|
|
5592
5760
|
{
|
|
5593
5761
|
name: "createData",
|
|
5594
5762
|
type: "tuple",
|
|
5595
5763
|
internalType: "struct CreateParams",
|
|
5596
|
-
components:
|
|
5597
|
-
{ name: "initialSupply", type: "uint256", internalType: "uint256" },
|
|
5598
|
-
{ name: "numTokensToSell", type: "uint256", internalType: "uint256" },
|
|
5599
|
-
{ name: "numeraire", type: "address", internalType: "address" },
|
|
5600
|
-
{
|
|
5601
|
-
name: "tokenFactory",
|
|
5602
|
-
type: "address",
|
|
5603
|
-
internalType: "contract ITokenFactory"
|
|
5604
|
-
},
|
|
5605
|
-
{ name: "tokenFactoryData", type: "bytes", internalType: "bytes" },
|
|
5606
|
-
{
|
|
5607
|
-
name: "governanceFactory",
|
|
5608
|
-
type: "address",
|
|
5609
|
-
internalType: "contract IGovernanceFactory"
|
|
5610
|
-
},
|
|
5611
|
-
{
|
|
5612
|
-
name: "governanceFactoryData",
|
|
5613
|
-
type: "bytes",
|
|
5614
|
-
internalType: "bytes"
|
|
5615
|
-
},
|
|
5616
|
-
{
|
|
5617
|
-
name: "poolInitializer",
|
|
5618
|
-
type: "address",
|
|
5619
|
-
internalType: "contract IPoolInitializer"
|
|
5620
|
-
},
|
|
5621
|
-
{ name: "poolInitializerData", type: "bytes", internalType: "bytes" },
|
|
5622
|
-
{
|
|
5623
|
-
name: "liquidityMigrator",
|
|
5624
|
-
type: "address",
|
|
5625
|
-
internalType: "contract ILiquidityMigrator"
|
|
5626
|
-
},
|
|
5627
|
-
{
|
|
5628
|
-
name: "liquidityMigratorData",
|
|
5629
|
-
type: "bytes",
|
|
5630
|
-
internalType: "bytes"
|
|
5631
|
-
},
|
|
5632
|
-
{ name: "integrator", type: "address", internalType: "address" },
|
|
5633
|
-
{ name: "salt", type: "bytes32", internalType: "bytes32" }
|
|
5634
|
-
]
|
|
5764
|
+
components: bundlerCreateParamsComponents
|
|
5635
5765
|
},
|
|
5766
|
+
{ name: "exactAmountIn", type: "uint128", internalType: "uint128" }
|
|
5767
|
+
],
|
|
5768
|
+
outputs: [
|
|
5769
|
+
{ name: "asset", type: "address", internalType: "address" },
|
|
5636
5770
|
{
|
|
5637
|
-
name: "
|
|
5771
|
+
name: "poolKey",
|
|
5638
5772
|
type: "tuple",
|
|
5639
|
-
internalType: "struct
|
|
5640
|
-
components:
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
{
|
|
5646
|
-
name: "sqrtPriceLimitX96",
|
|
5647
|
-
type: "uint160",
|
|
5648
|
-
internalType: "uint160"
|
|
5649
|
-
}
|
|
5650
|
-
]
|
|
5651
|
-
}
|
|
5773
|
+
internalType: "struct PoolKey",
|
|
5774
|
+
components: bundlerPoolKeyComponents
|
|
5775
|
+
},
|
|
5776
|
+
{ name: "governance", type: "address", internalType: "address" },
|
|
5777
|
+
{ name: "timelock", type: "address", internalType: "address" },
|
|
5778
|
+
{ name: "amountOut", type: "uint128", internalType: "uint128" }
|
|
5652
5779
|
],
|
|
5653
|
-
outputs: [{ name: "amountOut", type: "uint256", internalType: "uint256" }],
|
|
5654
5780
|
stateMutability: "nonpayable"
|
|
5655
5781
|
},
|
|
5656
5782
|
{
|
|
5657
5783
|
type: "function",
|
|
5658
|
-
name: "
|
|
5784
|
+
name: "_simulateBundle",
|
|
5659
5785
|
inputs: [
|
|
5660
5786
|
{
|
|
5661
5787
|
name: "createData",
|
|
5662
5788
|
type: "tuple",
|
|
5663
5789
|
internalType: "struct CreateParams",
|
|
5664
|
-
components:
|
|
5665
|
-
{ name: "initialSupply", type: "uint256", internalType: "uint256" },
|
|
5666
|
-
{ name: "numTokensToSell", type: "uint256", internalType: "uint256" },
|
|
5667
|
-
{ name: "numeraire", type: "address", internalType: "address" },
|
|
5668
|
-
{
|
|
5669
|
-
name: "tokenFactory",
|
|
5670
|
-
type: "address",
|
|
5671
|
-
internalType: "contract ITokenFactory"
|
|
5672
|
-
},
|
|
5673
|
-
{ name: "tokenFactoryData", type: "bytes", internalType: "bytes" },
|
|
5674
|
-
{
|
|
5675
|
-
name: "governanceFactory",
|
|
5676
|
-
type: "address",
|
|
5677
|
-
internalType: "contract IGovernanceFactory"
|
|
5678
|
-
},
|
|
5679
|
-
{
|
|
5680
|
-
name: "governanceFactoryData",
|
|
5681
|
-
type: "bytes",
|
|
5682
|
-
internalType: "bytes"
|
|
5683
|
-
},
|
|
5684
|
-
{
|
|
5685
|
-
name: "poolInitializer",
|
|
5686
|
-
type: "address",
|
|
5687
|
-
internalType: "contract IPoolInitializer"
|
|
5688
|
-
},
|
|
5689
|
-
{ name: "poolInitializerData", type: "bytes", internalType: "bytes" },
|
|
5690
|
-
{
|
|
5691
|
-
name: "liquidityMigrator",
|
|
5692
|
-
type: "address",
|
|
5693
|
-
internalType: "contract ILiquidityMigrator"
|
|
5694
|
-
},
|
|
5695
|
-
{
|
|
5696
|
-
name: "liquidityMigratorData",
|
|
5697
|
-
type: "bytes",
|
|
5698
|
-
internalType: "bytes"
|
|
5699
|
-
},
|
|
5700
|
-
{ name: "integrator", type: "address", internalType: "address" },
|
|
5701
|
-
{ name: "salt", type: "bytes32", internalType: "bytes32" }
|
|
5702
|
-
]
|
|
5790
|
+
components: bundlerCreateParamsComponents
|
|
5703
5791
|
},
|
|
5704
|
-
{
|
|
5705
|
-
name: "params",
|
|
5706
|
-
type: "tuple",
|
|
5707
|
-
internalType: "struct IQuoterV2.QuoteExactOutputSingleParams",
|
|
5708
|
-
components: [
|
|
5709
|
-
{ name: "tokenIn", type: "address", internalType: "address" },
|
|
5710
|
-
{ name: "tokenOut", type: "address", internalType: "address" },
|
|
5711
|
-
{ name: "amount", type: "uint256", internalType: "uint256" },
|
|
5712
|
-
{ name: "fee", type: "uint24", internalType: "uint24" },
|
|
5713
|
-
{
|
|
5714
|
-
name: "sqrtPriceLimitX96",
|
|
5715
|
-
type: "uint160",
|
|
5716
|
-
internalType: "uint160"
|
|
5717
|
-
}
|
|
5718
|
-
]
|
|
5719
|
-
}
|
|
5792
|
+
{ name: "exactAmountIn", type: "uint128", internalType: "uint128" }
|
|
5720
5793
|
],
|
|
5721
|
-
outputs: [
|
|
5794
|
+
outputs: [],
|
|
5722
5795
|
stateMutability: "nonpayable"
|
|
5723
5796
|
},
|
|
5724
5797
|
{
|
|
5725
5798
|
type: "function",
|
|
5726
|
-
name: "
|
|
5799
|
+
name: "unlockCallback",
|
|
5800
|
+
inputs: [{ name: "data", type: "bytes", internalType: "bytes" }],
|
|
5801
|
+
outputs: [{ name: "", type: "bytes", internalType: "bytes" }],
|
|
5802
|
+
stateMutability: "nonpayable"
|
|
5803
|
+
},
|
|
5804
|
+
{
|
|
5805
|
+
type: "event",
|
|
5806
|
+
name: "Bundled",
|
|
5727
5807
|
inputs: [
|
|
5728
5808
|
{
|
|
5729
|
-
name: "
|
|
5730
|
-
type: "
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
internalType: "contract IGovernanceFactory"
|
|
5746
|
-
},
|
|
5747
|
-
{
|
|
5748
|
-
name: "governanceFactoryData",
|
|
5749
|
-
type: "bytes",
|
|
5750
|
-
internalType: "bytes"
|
|
5751
|
-
},
|
|
5752
|
-
{
|
|
5753
|
-
name: "poolInitializer",
|
|
5754
|
-
type: "address",
|
|
5755
|
-
internalType: "contract IPoolInitializer"
|
|
5756
|
-
},
|
|
5757
|
-
{ name: "poolInitializerData", type: "bytes", internalType: "bytes" },
|
|
5758
|
-
{
|
|
5759
|
-
name: "liquidityMigrator",
|
|
5760
|
-
type: "address",
|
|
5761
|
-
internalType: "contract ILiquidityMigrator"
|
|
5762
|
-
},
|
|
5763
|
-
{
|
|
5764
|
-
name: "liquidityMigratorData",
|
|
5765
|
-
type: "bytes",
|
|
5766
|
-
internalType: "bytes"
|
|
5767
|
-
},
|
|
5768
|
-
{ name: "integrator", type: "address", internalType: "address" },
|
|
5769
|
-
{ name: "salt", type: "bytes32", internalType: "bytes32" }
|
|
5770
|
-
]
|
|
5809
|
+
name: "recipient",
|
|
5810
|
+
type: "address",
|
|
5811
|
+
indexed: true,
|
|
5812
|
+
internalType: "address"
|
|
5813
|
+
},
|
|
5814
|
+
{
|
|
5815
|
+
name: "amountIn",
|
|
5816
|
+
type: "uint128",
|
|
5817
|
+
indexed: false,
|
|
5818
|
+
internalType: "uint128"
|
|
5819
|
+
},
|
|
5820
|
+
{
|
|
5821
|
+
name: "amountOut",
|
|
5822
|
+
type: "uint128",
|
|
5823
|
+
indexed: false,
|
|
5824
|
+
internalType: "uint128"
|
|
5771
5825
|
},
|
|
5772
|
-
{ name: "exactAmountOut", type: "uint128", internalType: "uint128" },
|
|
5773
|
-
{ name: "hookData", type: "bytes", internalType: "bytes" }
|
|
5774
|
-
],
|
|
5775
|
-
outputs: [
|
|
5776
|
-
{ name: "asset", type: "address", internalType: "address" },
|
|
5777
5826
|
{
|
|
5778
5827
|
name: "poolKey",
|
|
5779
5828
|
type: "tuple",
|
|
5829
|
+
indexed: false,
|
|
5780
5830
|
internalType: "struct PoolKey",
|
|
5781
|
-
components:
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5831
|
+
components: bundlerPoolKeyComponents
|
|
5832
|
+
}
|
|
5833
|
+
],
|
|
5834
|
+
anonymous: false
|
|
5835
|
+
},
|
|
5836
|
+
{
|
|
5837
|
+
type: "event",
|
|
5838
|
+
name: "VestingCreated",
|
|
5839
|
+
inputs: [
|
|
5840
|
+
{
|
|
5841
|
+
name: "asset",
|
|
5842
|
+
type: "address",
|
|
5843
|
+
indexed: true,
|
|
5844
|
+
internalType: "address"
|
|
5788
5845
|
},
|
|
5789
|
-
{
|
|
5790
|
-
|
|
5846
|
+
{
|
|
5847
|
+
name: "recipient",
|
|
5848
|
+
type: "address",
|
|
5849
|
+
indexed: true,
|
|
5850
|
+
internalType: "address"
|
|
5851
|
+
},
|
|
5852
|
+
{
|
|
5853
|
+
name: "permissionlessClaim",
|
|
5854
|
+
type: "bool",
|
|
5855
|
+
indexed: false,
|
|
5856
|
+
internalType: "bool"
|
|
5857
|
+
},
|
|
5858
|
+
{
|
|
5859
|
+
name: "totalAmount",
|
|
5860
|
+
type: "uint128",
|
|
5861
|
+
indexed: false,
|
|
5862
|
+
internalType: "uint128"
|
|
5863
|
+
},
|
|
5864
|
+
{
|
|
5865
|
+
name: "start",
|
|
5866
|
+
type: "uint64",
|
|
5867
|
+
indexed: false,
|
|
5868
|
+
internalType: "uint64"
|
|
5869
|
+
},
|
|
5870
|
+
{
|
|
5871
|
+
name: "cliffDuration",
|
|
5872
|
+
type: "uint64",
|
|
5873
|
+
indexed: false,
|
|
5874
|
+
internalType: "uint64"
|
|
5875
|
+
},
|
|
5876
|
+
{
|
|
5877
|
+
name: "vestingDuration",
|
|
5878
|
+
type: "uint64",
|
|
5879
|
+
indexed: false,
|
|
5880
|
+
internalType: "uint64"
|
|
5881
|
+
}
|
|
5791
5882
|
],
|
|
5792
|
-
|
|
5883
|
+
anonymous: false
|
|
5793
5884
|
},
|
|
5794
5885
|
{
|
|
5795
|
-
type: "
|
|
5796
|
-
name: "
|
|
5886
|
+
type: "event",
|
|
5887
|
+
name: "VestingReleased",
|
|
5797
5888
|
inputs: [
|
|
5798
5889
|
{
|
|
5799
|
-
name: "
|
|
5800
|
-
type: "
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
{ name: "initialSupply", type: "uint256", internalType: "uint256" },
|
|
5804
|
-
{ name: "numTokensToSell", type: "uint256", internalType: "uint256" },
|
|
5805
|
-
{ name: "numeraire", type: "address", internalType: "address" },
|
|
5806
|
-
{
|
|
5807
|
-
name: "tokenFactory",
|
|
5808
|
-
type: "address",
|
|
5809
|
-
internalType: "contract ITokenFactory"
|
|
5810
|
-
},
|
|
5811
|
-
{ name: "tokenFactoryData", type: "bytes", internalType: "bytes" },
|
|
5812
|
-
{
|
|
5813
|
-
name: "governanceFactory",
|
|
5814
|
-
type: "address",
|
|
5815
|
-
internalType: "contract IGovernanceFactory"
|
|
5816
|
-
},
|
|
5817
|
-
{
|
|
5818
|
-
name: "governanceFactoryData",
|
|
5819
|
-
type: "bytes",
|
|
5820
|
-
internalType: "bytes"
|
|
5821
|
-
},
|
|
5822
|
-
{
|
|
5823
|
-
name: "poolInitializer",
|
|
5824
|
-
type: "address",
|
|
5825
|
-
internalType: "contract IPoolInitializer"
|
|
5826
|
-
},
|
|
5827
|
-
{ name: "poolInitializerData", type: "bytes", internalType: "bytes" },
|
|
5828
|
-
{
|
|
5829
|
-
name: "liquidityMigrator",
|
|
5830
|
-
type: "address",
|
|
5831
|
-
internalType: "contract ILiquidityMigrator"
|
|
5832
|
-
},
|
|
5833
|
-
{
|
|
5834
|
-
name: "liquidityMigratorData",
|
|
5835
|
-
type: "bytes",
|
|
5836
|
-
internalType: "bytes"
|
|
5837
|
-
},
|
|
5838
|
-
{ name: "integrator", type: "address", internalType: "address" },
|
|
5839
|
-
{ name: "salt", type: "bytes32", internalType: "bytes32" }
|
|
5840
|
-
]
|
|
5890
|
+
name: "asset",
|
|
5891
|
+
type: "address",
|
|
5892
|
+
indexed: true,
|
|
5893
|
+
internalType: "address"
|
|
5841
5894
|
},
|
|
5842
|
-
{
|
|
5843
|
-
|
|
5895
|
+
{
|
|
5896
|
+
name: "recipient",
|
|
5897
|
+
type: "address",
|
|
5898
|
+
indexed: true,
|
|
5899
|
+
internalType: "address"
|
|
5900
|
+
},
|
|
5901
|
+
{
|
|
5902
|
+
name: "amount",
|
|
5903
|
+
type: "uint128",
|
|
5904
|
+
indexed: false,
|
|
5905
|
+
internalType: "uint128"
|
|
5906
|
+
}
|
|
5844
5907
|
],
|
|
5845
|
-
|
|
5908
|
+
anonymous: false
|
|
5909
|
+
},
|
|
5910
|
+
{
|
|
5911
|
+
type: "error",
|
|
5912
|
+
name: "BundleQuote",
|
|
5913
|
+
inputs: [
|
|
5846
5914
|
{ name: "asset", type: "address", internalType: "address" },
|
|
5847
5915
|
{
|
|
5848
5916
|
name: "poolKey",
|
|
5849
5917
|
type: "tuple",
|
|
5850
5918
|
internalType: "struct PoolKey",
|
|
5851
|
-
components:
|
|
5852
|
-
{ name: "currency0", type: "address", internalType: "Currency" },
|
|
5853
|
-
{ name: "currency1", type: "address", internalType: "Currency" },
|
|
5854
|
-
{ name: "fee", type: "uint24", internalType: "uint24" },
|
|
5855
|
-
{ name: "tickSpacing", type: "int24", internalType: "int24" },
|
|
5856
|
-
{ name: "hooks", type: "address", internalType: "contract IHooks" }
|
|
5857
|
-
]
|
|
5919
|
+
components: bundlerPoolKeyComponents
|
|
5858
5920
|
},
|
|
5859
|
-
{ name: "
|
|
5860
|
-
{ name: "
|
|
5861
|
-
|
|
5862
|
-
|
|
5921
|
+
{ name: "governance", type: "address", internalType: "address" },
|
|
5922
|
+
{ name: "timelock", type: "address", internalType: "address" },
|
|
5923
|
+
{ name: "amountOut", type: "uint128", internalType: "uint128" }
|
|
5924
|
+
]
|
|
5863
5925
|
},
|
|
5864
|
-
{
|
|
5865
|
-
|
|
5866
|
-
|
|
5926
|
+
{
|
|
5927
|
+
type: "error",
|
|
5928
|
+
name: "ExactInputNotFullySpent",
|
|
5929
|
+
inputs: [
|
|
5930
|
+
{ name: "expected", type: "uint256", internalType: "uint256" },
|
|
5931
|
+
{ name: "actual", type: "uint256", internalType: "uint256" }
|
|
5932
|
+
]
|
|
5933
|
+
},
|
|
5934
|
+
{ type: "error", name: "ExactInputAmountZero", inputs: [] },
|
|
5935
|
+
{ type: "error", name: "InvalidAddress", inputs: [] },
|
|
5936
|
+
{ type: "error", name: "InvalidNativeValue", inputs: [] },
|
|
5937
|
+
{ type: "error", name: "InvalidPool", inputs: [] },
|
|
5938
|
+
{ type: "error", name: "InvalidRecipient", inputs: [] },
|
|
5939
|
+
{ type: "error", name: "InvalidVestingSchedule", inputs: [] },
|
|
5940
|
+
{ type: "error", name: "NoClaimableAmount", inputs: [] },
|
|
5941
|
+
{ type: "error", name: "SenderNotPoolManager", inputs: [] },
|
|
5942
|
+
{ type: "error", name: "SenderNotRecipient", inputs: [] },
|
|
5943
|
+
{ type: "error", name: "SenderNotSelf", inputs: [] },
|
|
5944
|
+
{
|
|
5945
|
+
type: "error",
|
|
5946
|
+
name: "SwapQuote",
|
|
5947
|
+
inputs: [{ name: "amountOut", type: "uint128", internalType: "uint128" }]
|
|
5948
|
+
},
|
|
5949
|
+
{ type: "error", name: "UnexpectedSimulationSuccess", inputs: [] },
|
|
5950
|
+
{
|
|
5951
|
+
type: "error",
|
|
5952
|
+
name: "VestingAlreadyExists",
|
|
5953
|
+
inputs: [{ name: "asset", type: "address", internalType: "address" }]
|
|
5954
|
+
}
|
|
5867
5955
|
];
|
|
5868
5956
|
var poolManagerAbi = [
|
|
5869
5957
|
{
|
|
@@ -6074,6 +6162,13 @@ var rehypeDopplerHookInitializerAbi = [
|
|
|
6074
6162
|
],
|
|
6075
6163
|
stateMutability: "view"
|
|
6076
6164
|
},
|
|
6165
|
+
{
|
|
6166
|
+
type: "function",
|
|
6167
|
+
name: "bundler",
|
|
6168
|
+
inputs: [],
|
|
6169
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
6170
|
+
stateMutability: "view"
|
|
6171
|
+
},
|
|
6077
6172
|
{
|
|
6078
6173
|
type: "function",
|
|
6079
6174
|
name: "quoter",
|
|
@@ -6195,6 +6290,51 @@ var rehypeDopplerHookInitializerAbi = [
|
|
|
6195
6290
|
],
|
|
6196
6291
|
anonymous: false
|
|
6197
6292
|
},
|
|
6293
|
+
{
|
|
6294
|
+
type: "function",
|
|
6295
|
+
name: "setFeeDistribution",
|
|
6296
|
+
inputs: [
|
|
6297
|
+
{ name: "poolId", type: "bytes32", internalType: "PoolId" },
|
|
6298
|
+
{
|
|
6299
|
+
name: "assetFeesToAssetBuybackWad",
|
|
6300
|
+
type: "uint256",
|
|
6301
|
+
internalType: "uint256"
|
|
6302
|
+
},
|
|
6303
|
+
{
|
|
6304
|
+
name: "assetFeesToNumeraireBuybackWad",
|
|
6305
|
+
type: "uint256",
|
|
6306
|
+
internalType: "uint256"
|
|
6307
|
+
},
|
|
6308
|
+
{
|
|
6309
|
+
name: "assetFeesToBeneficiaryWad",
|
|
6310
|
+
type: "uint256",
|
|
6311
|
+
internalType: "uint256"
|
|
6312
|
+
},
|
|
6313
|
+
{ name: "assetFeesToLpWad", type: "uint256", internalType: "uint256" },
|
|
6314
|
+
{
|
|
6315
|
+
name: "numeraireFeesToAssetBuybackWad",
|
|
6316
|
+
type: "uint256",
|
|
6317
|
+
internalType: "uint256"
|
|
6318
|
+
},
|
|
6319
|
+
{
|
|
6320
|
+
name: "numeraireFeesToNumeraireBuybackWad",
|
|
6321
|
+
type: "uint256",
|
|
6322
|
+
internalType: "uint256"
|
|
6323
|
+
},
|
|
6324
|
+
{
|
|
6325
|
+
name: "numeraireFeesToBeneficiaryWad",
|
|
6326
|
+
type: "uint256",
|
|
6327
|
+
internalType: "uint256"
|
|
6328
|
+
},
|
|
6329
|
+
{
|
|
6330
|
+
name: "numeraireFeesToLpWad",
|
|
6331
|
+
type: "uint256",
|
|
6332
|
+
internalType: "uint256"
|
|
6333
|
+
}
|
|
6334
|
+
],
|
|
6335
|
+
outputs: [],
|
|
6336
|
+
stateMutability: "nonpayable"
|
|
6337
|
+
},
|
|
6198
6338
|
{ type: "error", name: "FeeBeneficiariesNotConfigured", inputs: [] },
|
|
6199
6339
|
{
|
|
6200
6340
|
type: "error",
|
|
@@ -6202,6 +6342,7 @@ var rehypeDopplerHookInitializerAbi = [
|
|
|
6202
6342
|
inputs: []
|
|
6203
6343
|
},
|
|
6204
6344
|
{ type: "error", name: "FeeDistributionMustAddUpToWAD", inputs: [] },
|
|
6345
|
+
{ type: "error", name: "SenderNotAuthorized", inputs: [] },
|
|
6205
6346
|
{
|
|
6206
6347
|
type: "error",
|
|
6207
6348
|
name: "FeeTooHigh",
|
|
@@ -6851,7 +6992,6 @@ function getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1) {
|
|
|
6851
6992
|
}
|
|
6852
6993
|
|
|
6853
6994
|
// src/evm/utils/multicurveLiquidity.ts
|
|
6854
|
-
var MAX_UINT128 = (1n << 128n) - 1n;
|
|
6855
6995
|
function getMaxLiquiditySafeMulticurveTickUpper(params) {
|
|
6856
6996
|
if (params.tickUpper <= params.tickLower) {
|
|
6857
6997
|
throw new Error(
|
|
@@ -7023,6 +7163,7 @@ function isNonEmpty(values) {
|
|
|
7023
7163
|
var NO_OP_ENABLED_CHAIN_IDS = [
|
|
7024
7164
|
CHAIN_IDS.MAINNET,
|
|
7025
7165
|
CHAIN_IDS.ETH_SEPOLIA,
|
|
7166
|
+
CHAIN_IDS.ARBITRUM,
|
|
7026
7167
|
CHAIN_IDS.BASE,
|
|
7027
7168
|
CHAIN_IDS.BASE_SEPOLIA,
|
|
7028
7169
|
CHAIN_IDS.UNICHAIN,
|
|
@@ -7036,6 +7177,7 @@ function isNoOpEnabledChain(chainId) {
|
|
|
7036
7177
|
}
|
|
7037
7178
|
var LAUNCHPAD_ENABLED_CHAIN_IDS = [
|
|
7038
7179
|
CHAIN_IDS.MAINNET,
|
|
7180
|
+
CHAIN_IDS.ARBITRUM,
|
|
7039
7181
|
CHAIN_IDS.BASE,
|
|
7040
7182
|
CHAIN_IDS.BASE_SEPOLIA,
|
|
7041
7183
|
CHAIN_IDS.ROBINHOOD,
|
|
@@ -7124,14 +7266,21 @@ function validateFeeDistributionInfo(feeDistributionInfo) {
|
|
|
7124
7266
|
}
|
|
7125
7267
|
|
|
7126
7268
|
// src/evm/utils/rehypeDopplerHookInitializer.ts
|
|
7127
|
-
function normalizeRehypeDopplerHookInitializerConfig(config) {
|
|
7269
|
+
function normalizeRehypeDopplerHookInitializerConfig(config, controllerOverride) {
|
|
7128
7270
|
assertNonZeroAddress(config.hookAddress, "Rehype hookAddress");
|
|
7129
|
-
|
|
7130
|
-
|
|
7271
|
+
if (config.buybackDestination !== void 0 && controllerOverride !== void 0) {
|
|
7272
|
+
throw new Error(
|
|
7273
|
+
"Rehype buybackDestination and withFeeDistributionController are mutually exclusive"
|
|
7274
|
+
);
|
|
7275
|
+
}
|
|
7276
|
+
const buybackDestination = config.buybackDestination ?? controllerOverride;
|
|
7277
|
+
if (buybackDestination === void 0) {
|
|
7131
7278
|
throw new Error(
|
|
7132
|
-
"Rehype buybackDestination
|
|
7279
|
+
"Rehype requires buybackDestination or withFeeDistributionController"
|
|
7133
7280
|
);
|
|
7134
7281
|
}
|
|
7282
|
+
assertNonZeroAddress(buybackDestination, "Rehype buybackDestination");
|
|
7283
|
+
const feeBeneficiaries = config.feeBeneficiaries;
|
|
7135
7284
|
const feeDistributionInfo = resolveRehypeFeeDistributionInfo(config);
|
|
7136
7285
|
const { startFee, endFee, durationSeconds, startingTime } = normalizeFeeSchedule(config);
|
|
7137
7286
|
const feeRoutingMode = feeBeneficiaries !== void 0 ? normalizeBeneficiaryFeeRoutingMode(config.feeRoutingMode) : normalizeFeeRoutingMode(config.feeRoutingMode);
|
|
@@ -7154,19 +7303,14 @@ function normalizeRehypeDopplerHookInitializerConfig(config) {
|
|
|
7154
7303
|
);
|
|
7155
7304
|
return {
|
|
7156
7305
|
...common,
|
|
7306
|
+
buybackDestination,
|
|
7157
7307
|
feeBeneficiaries: normalizedBeneficiaries,
|
|
7158
7308
|
feeRoutingMode: 1 /* RouteToBeneficiaryFees */
|
|
7159
7309
|
};
|
|
7160
7310
|
}
|
|
7161
|
-
if (config.buybackDestination === void 0) {
|
|
7162
|
-
throw new Error(
|
|
7163
|
-
"Rehype requires either buybackDestination or feeBeneficiaries"
|
|
7164
|
-
);
|
|
7165
|
-
}
|
|
7166
|
-
assertNonZeroAddress(config.buybackDestination, "Rehype buybackDestination");
|
|
7167
7311
|
return {
|
|
7168
7312
|
...common,
|
|
7169
|
-
buybackDestination
|
|
7313
|
+
buybackDestination,
|
|
7170
7314
|
feeRoutingMode
|
|
7171
7315
|
};
|
|
7172
7316
|
}
|
|
@@ -7484,6 +7628,44 @@ function assertAddressMatch(code, expected, actual) {
|
|
|
7484
7628
|
throw new AirlockCreateReceiptError(code, { expected, actual });
|
|
7485
7629
|
}
|
|
7486
7630
|
}
|
|
7631
|
+
function normalizePoolKey2(value) {
|
|
7632
|
+
if (Array.isArray(value)) {
|
|
7633
|
+
return {
|
|
7634
|
+
currency0: value[0],
|
|
7635
|
+
currency1: value[1],
|
|
7636
|
+
fee: Number(value[2]),
|
|
7637
|
+
tickSpacing: Number(value[3]),
|
|
7638
|
+
hooks: value[4]
|
|
7639
|
+
};
|
|
7640
|
+
}
|
|
7641
|
+
const poolKey = value;
|
|
7642
|
+
return {
|
|
7643
|
+
currency0: poolKey.currency0,
|
|
7644
|
+
currency1: poolKey.currency1,
|
|
7645
|
+
fee: Number(poolKey.fee),
|
|
7646
|
+
tickSpacing: Number(poolKey.tickSpacing),
|
|
7647
|
+
hooks: poolKey.hooks
|
|
7648
|
+
};
|
|
7649
|
+
}
|
|
7650
|
+
function poolId(poolKey) {
|
|
7651
|
+
return viem.keccak256(
|
|
7652
|
+
viem.encodeAbiParameters(
|
|
7653
|
+
[
|
|
7654
|
+
{
|
|
7655
|
+
type: "tuple",
|
|
7656
|
+
components: [
|
|
7657
|
+
{ name: "currency0", type: "address" },
|
|
7658
|
+
{ name: "currency1", type: "address" },
|
|
7659
|
+
{ name: "fee", type: "uint24" },
|
|
7660
|
+
{ name: "tickSpacing", type: "int24" },
|
|
7661
|
+
{ name: "hooks", type: "address" }
|
|
7662
|
+
]
|
|
7663
|
+
}
|
|
7664
|
+
],
|
|
7665
|
+
[poolKey]
|
|
7666
|
+
)
|
|
7667
|
+
);
|
|
7668
|
+
}
|
|
7487
7669
|
function verifyPreparedCreateReceipt({
|
|
7488
7670
|
prepared,
|
|
7489
7671
|
receipt
|
|
@@ -7534,6 +7716,86 @@ function verifyPreparedCreateReceipt({
|
|
|
7534
7716
|
prepared.prediction.poolOrHookAddress,
|
|
7535
7717
|
receiptIdentity.poolOrHookAddress
|
|
7536
7718
|
);
|
|
7719
|
+
let verifiedDevBuy;
|
|
7720
|
+
if (prepared.devBuy) {
|
|
7721
|
+
const bundledEvents = [];
|
|
7722
|
+
const vestingEvents = [];
|
|
7723
|
+
for (const log of receipt.logs) {
|
|
7724
|
+
if (!addressesEqual(log.address, prepared.devBuy.bundler)) continue;
|
|
7725
|
+
try {
|
|
7726
|
+
const decoded = viem.decodeEventLog({
|
|
7727
|
+
abi: bundlerAbi,
|
|
7728
|
+
data: log.data,
|
|
7729
|
+
topics: log.topics
|
|
7730
|
+
});
|
|
7731
|
+
if (decoded.eventName === "Bundled") {
|
|
7732
|
+
const args = decoded.args;
|
|
7733
|
+
bundledEvents.push({
|
|
7734
|
+
recipient: args.recipient,
|
|
7735
|
+
amountIn: args.amountIn,
|
|
7736
|
+
amountOut: args.amountOut,
|
|
7737
|
+
poolKey: normalizePoolKey2(args.poolKey)
|
|
7738
|
+
});
|
|
7739
|
+
} else if (decoded.eventName === "VestingCreated") {
|
|
7740
|
+
const args = decoded.args;
|
|
7741
|
+
vestingEvents.push(args);
|
|
7742
|
+
}
|
|
7743
|
+
} catch {
|
|
7744
|
+
}
|
|
7745
|
+
}
|
|
7746
|
+
if (bundledEvents.length === 0) {
|
|
7747
|
+
throw new AirlockCreateReceiptError("MISSING_BUNDLED_EVENT");
|
|
7748
|
+
}
|
|
7749
|
+
if (bundledEvents.length > 1) {
|
|
7750
|
+
throw new AirlockCreateReceiptError("MULTIPLE_BUNDLED_EVENTS", {
|
|
7751
|
+
expected: 1,
|
|
7752
|
+
actual: bundledEvents.length
|
|
7753
|
+
});
|
|
7754
|
+
}
|
|
7755
|
+
const bundled = bundledEvents[0];
|
|
7756
|
+
if (!addressesEqual(bundled.recipient, prepared.devBuy.recipient)) {
|
|
7757
|
+
throw new AirlockCreateReceiptError("BUNDLED_RECIPIENT_MISMATCH", {
|
|
7758
|
+
expected: prepared.devBuy.recipient,
|
|
7759
|
+
actual: bundled.recipient
|
|
7760
|
+
});
|
|
7761
|
+
}
|
|
7762
|
+
if (bundled.amountIn !== prepared.devBuy.exactAmountIn) {
|
|
7763
|
+
throw new AirlockCreateReceiptError("BUNDLED_INPUT_MISMATCH", {
|
|
7764
|
+
expected: prepared.devBuy.exactAmountIn.toString(),
|
|
7765
|
+
actual: bundled.amountIn.toString()
|
|
7766
|
+
});
|
|
7767
|
+
}
|
|
7768
|
+
const bundledPoolId = poolId(bundled.poolKey);
|
|
7769
|
+
if (bundledPoolId.toLowerCase() !== prepared.prediction.poolId.toLowerCase()) {
|
|
7770
|
+
throw new AirlockCreateReceiptError("BUNDLED_POOL_KEY_MISMATCH", {
|
|
7771
|
+
expected: prepared.prediction.poolId,
|
|
7772
|
+
actual: bundledPoolId
|
|
7773
|
+
});
|
|
7774
|
+
}
|
|
7775
|
+
if (prepared.devBuy.vesting.vestingDuration === 0n) {
|
|
7776
|
+
if (vestingEvents.length !== 0) {
|
|
7777
|
+
throw new AirlockCreateReceiptError("UNEXPECTED_VESTING_EVENT", {
|
|
7778
|
+
expected: 0,
|
|
7779
|
+
actual: vestingEvents.length
|
|
7780
|
+
});
|
|
7781
|
+
}
|
|
7782
|
+
} else {
|
|
7783
|
+
if (vestingEvents.length === 0) {
|
|
7784
|
+
throw new AirlockCreateReceiptError("MISSING_VESTING_EVENT");
|
|
7785
|
+
}
|
|
7786
|
+
if (vestingEvents.length > 1) {
|
|
7787
|
+
throw new AirlockCreateReceiptError("MULTIPLE_VESTING_EVENTS", {
|
|
7788
|
+
expected: 1,
|
|
7789
|
+
actual: vestingEvents.length
|
|
7790
|
+
});
|
|
7791
|
+
}
|
|
7792
|
+
const vesting = vestingEvents[0];
|
|
7793
|
+
if (!addressesEqual(vesting.asset, prepared.prediction.tokenAddress) || !addressesEqual(vesting.recipient, prepared.devBuy.recipient) || vesting.totalAmount !== bundled.amountOut || vesting.permissionlessClaim !== prepared.devBuy.vesting.permissionlessClaim || vesting.cliffDuration !== prepared.devBuy.vesting.cliffDuration || vesting.vestingDuration !== prepared.devBuy.vesting.vestingDuration) {
|
|
7794
|
+
throw new AirlockCreateReceiptError("VESTING_MISMATCH");
|
|
7795
|
+
}
|
|
7796
|
+
}
|
|
7797
|
+
verifiedDevBuy = { amountOut: bundled.amountOut };
|
|
7798
|
+
}
|
|
7537
7799
|
return {
|
|
7538
7800
|
receiptIdentity,
|
|
7539
7801
|
preparedIdentity: {
|
|
@@ -7546,7 +7808,8 @@ function verifyPreparedCreateReceipt({
|
|
|
7546
7808
|
poolKey: prepared.prediction.poolKey,
|
|
7547
7809
|
poolId: prepared.prediction.poolId,
|
|
7548
7810
|
tokenIsCurrency0: prepared.prediction.tokenIsCurrency0
|
|
7549
|
-
}
|
|
7811
|
+
},
|
|
7812
|
+
devBuy: verifiedDevBuy
|
|
7550
7813
|
};
|
|
7551
7814
|
}
|
|
7552
7815
|
async function verifyPreparedCreateExecution({
|
|
@@ -7862,6 +8125,42 @@ function tickToMarketCap(params) {
|
|
|
7862
8125
|
}
|
|
7863
8126
|
|
|
7864
8127
|
// src/evm/builders/shared.ts
|
|
8128
|
+
function normalizeBuilderDevBuy(params) {
|
|
8129
|
+
if (params.exactAmountIn <= 0n || params.exactAmountIn > MAX_UINT128) {
|
|
8130
|
+
throw new Error("Dev buy exactAmountIn must be in the uint128 range");
|
|
8131
|
+
}
|
|
8132
|
+
if (params.recipient.toLowerCase() === ZERO_ADDRESS) {
|
|
8133
|
+
throw new Error("Dev buy recipient must not be the zero address");
|
|
8134
|
+
}
|
|
8135
|
+
const vestingDuration = params.vesting?.vestingDuration ?? 0n;
|
|
8136
|
+
const cliffDuration = params.vesting?.cliffDuration ?? 0n;
|
|
8137
|
+
if (vestingDuration < 0n || vestingDuration > MAX_UINT64) {
|
|
8138
|
+
throw new Error("Dev buy vestingDuration must be in the uint64 range");
|
|
8139
|
+
}
|
|
8140
|
+
if (cliffDuration < 0n || cliffDuration > MAX_UINT64) {
|
|
8141
|
+
throw new Error("Dev buy cliffDuration must be in the uint64 range");
|
|
8142
|
+
}
|
|
8143
|
+
if (params.vesting && vestingDuration === 0n) {
|
|
8144
|
+
throw new Error(
|
|
8145
|
+
"Dev buy vestingDuration must be greater than zero when vesting is configured"
|
|
8146
|
+
);
|
|
8147
|
+
}
|
|
8148
|
+
if (vestingDuration !== 0n && vestingDuration < MIN_BUNDLER_VESTING_DURATION) {
|
|
8149
|
+
throw new Error("Dev buy vestingDuration must be at least 86400 seconds");
|
|
8150
|
+
}
|
|
8151
|
+
if (cliffDuration > vestingDuration) {
|
|
8152
|
+
throw new Error("Dev buy cliffDuration must not exceed vestingDuration");
|
|
8153
|
+
}
|
|
8154
|
+
return {
|
|
8155
|
+
exactAmountIn: params.exactAmountIn,
|
|
8156
|
+
recipient: params.recipient,
|
|
8157
|
+
vesting: {
|
|
8158
|
+
permissionlessClaim: params.vesting?.permissionlessClaim ?? false,
|
|
8159
|
+
vestingDuration,
|
|
8160
|
+
cliffDuration
|
|
8161
|
+
}
|
|
8162
|
+
};
|
|
8163
|
+
}
|
|
7865
8164
|
function assertTokenConfigSupportsYearlyMintRate(params) {
|
|
7866
8165
|
if ("yearlyMintRate" in params && params.type !== "standard") {
|
|
7867
8166
|
throw new Error(
|
|
@@ -8031,7 +8330,6 @@ function buildCurvesFromPresets(params) {
|
|
|
8031
8330
|
}
|
|
8032
8331
|
|
|
8033
8332
|
// src/evm/entities/DopplerFactory.ts
|
|
8034
|
-
var MAX_UINT1282 = (1n << 128n) - 1n;
|
|
8035
8333
|
var MAX_PROCEEDS_SPLIT_SHARE = WAD / 2n;
|
|
8036
8334
|
function isDopplerHookMigratorConfig(config) {
|
|
8037
8335
|
return config.type === "dopplerHookMigrator" || config.type === "dopplerHook";
|
|
@@ -8052,14 +8350,12 @@ var erc20BalanceOfAbi = [
|
|
|
8052
8350
|
];
|
|
8053
8351
|
var TOKEN_FACTORY_80_ADDRESS2 = "0xf0b5141dd9096254b2ca624dff26024f46087229";
|
|
8054
8352
|
var DERC20_V2_MIN_VESTING_DURATION = 24 * 60 * 60;
|
|
8055
|
-
var MAX_UINT64 = (1n << 64n) - 1n;
|
|
8056
8353
|
var MAX_UINT48 = (1n << 48n) - 1n;
|
|
8057
8354
|
var DopplerFactory = class {
|
|
8058
8355
|
publicClient;
|
|
8059
8356
|
walletClient;
|
|
8060
8357
|
chainId;
|
|
8061
8358
|
customMigrationEncoder;
|
|
8062
|
-
multicurveBundlerSupport = /* @__PURE__ */ new Map();
|
|
8063
8359
|
constructor(publicClient, walletClient, chainId) {
|
|
8064
8360
|
this.publicClient = publicClient;
|
|
8065
8361
|
this.walletClient = walletClient;
|
|
@@ -8960,7 +9256,6 @@ var DopplerFactory = class {
|
|
|
8960
9256
|
}
|
|
8961
9257
|
/**
|
|
8962
9258
|
* Simulate a static auction creation and return predicted addresses.
|
|
8963
|
-
* Useful for pre-buy flows (bundle) to know the token/pool before sending.
|
|
8964
9259
|
*/
|
|
8965
9260
|
async simulateCreateStaticAuction(params) {
|
|
8966
9261
|
const createParams = await this.encodeCreateStaticAuctionParams(params);
|
|
@@ -9436,7 +9731,7 @@ var DopplerFactory = class {
|
|
|
9436
9731
|
);
|
|
9437
9732
|
}
|
|
9438
9733
|
}
|
|
9439
|
-
const
|
|
9734
|
+
const poolId2 = this.computePoolId({
|
|
9440
9735
|
currency0: actualTokenAddress < params.sale.numeraire ? actualTokenAddress : params.sale.numeraire,
|
|
9441
9736
|
currency1: actualTokenAddress < params.sale.numeraire ? params.sale.numeraire : actualTokenAddress,
|
|
9442
9737
|
fee: params.pool.fee,
|
|
@@ -9446,7 +9741,7 @@ var DopplerFactory = class {
|
|
|
9446
9741
|
return {
|
|
9447
9742
|
hookAddress: actualHookAddress,
|
|
9448
9743
|
tokenAddress: actualTokenAddress,
|
|
9449
|
-
poolId,
|
|
9744
|
+
poolId: poolId2,
|
|
9450
9745
|
transactionHash: hash
|
|
9451
9746
|
};
|
|
9452
9747
|
}
|
|
@@ -9477,7 +9772,7 @@ var DopplerFactory = class {
|
|
|
9477
9772
|
}
|
|
9478
9773
|
const tokenAddress = simResult[0];
|
|
9479
9774
|
const hookAddress = simResult[1];
|
|
9480
|
-
const
|
|
9775
|
+
const poolId2 = this.computePoolId({
|
|
9481
9776
|
currency0: tokenAddress < params.sale.numeraire ? tokenAddress : params.sale.numeraire,
|
|
9482
9777
|
currency1: tokenAddress < params.sale.numeraire ? params.sale.numeraire : tokenAddress,
|
|
9483
9778
|
fee: params.pool.fee,
|
|
@@ -9496,7 +9791,7 @@ var DopplerFactory = class {
|
|
|
9496
9791
|
createParams: createParamsWithTimelock,
|
|
9497
9792
|
hookAddress,
|
|
9498
9793
|
tokenAddress,
|
|
9499
|
-
poolId,
|
|
9794
|
+
poolId: poolId2,
|
|
9500
9795
|
gasEstimate,
|
|
9501
9796
|
execute: () => this.createDynamicAuction(params, {
|
|
9502
9797
|
_createParams: createParamsWithTimelock
|
|
@@ -10839,12 +11134,9 @@ var DopplerFactory = class {
|
|
|
10839
11134
|
)
|
|
10840
11135
|
};
|
|
10841
11136
|
} else if (hasLegacyHook) {
|
|
10842
|
-
mode = {
|
|
10843
|
-
type: "rehype",
|
|
10844
|
-
hookConfig: legacyHook
|
|
10845
|
-
};
|
|
11137
|
+
mode = { type: "dopplerHook", hookConfig: legacyHook };
|
|
10846
11138
|
} else {
|
|
10847
|
-
mode = { type: "
|
|
11139
|
+
mode = { type: "dopplerHook" };
|
|
10848
11140
|
}
|
|
10849
11141
|
} else {
|
|
10850
11142
|
switch (initializer.type) {
|
|
@@ -10855,7 +11147,7 @@ var DopplerFactory = class {
|
|
|
10855
11147
|
"Initializer type 'dopplerHookInitializer' cannot be combined with legacy schedule or RehypeDopplerHookInitializer configuration"
|
|
10856
11148
|
);
|
|
10857
11149
|
}
|
|
10858
|
-
mode = { type: "
|
|
11150
|
+
mode = { type: "dopplerHook" };
|
|
10859
11151
|
break;
|
|
10860
11152
|
}
|
|
10861
11153
|
case "standard": {
|
|
@@ -10944,7 +11236,7 @@ var DopplerFactory = class {
|
|
|
10944
11236
|
"Initializer type 'rehype' cannot be combined with schedule"
|
|
10945
11237
|
);
|
|
10946
11238
|
}
|
|
10947
|
-
mode = { type: "
|
|
11239
|
+
mode = { type: "dopplerHook", hookConfig: initializer.config };
|
|
10948
11240
|
break;
|
|
10949
11241
|
}
|
|
10950
11242
|
default: {
|
|
@@ -10957,8 +11249,8 @@ var DopplerFactory = class {
|
|
|
10957
11249
|
}
|
|
10958
11250
|
if (params.modules?.dopplerHookInitializer !== void 0) {
|
|
10959
11251
|
if (mode.type === "standard") {
|
|
10960
|
-
mode = { type: "
|
|
10961
|
-
} else if (mode.type !== "
|
|
11252
|
+
mode = { type: "dopplerHook" };
|
|
11253
|
+
} else if (mode.type !== "dopplerHook") {
|
|
10962
11254
|
throw new Error(
|
|
10963
11255
|
"modules.dopplerHookInitializer can only be used with the dopplerHookInitializer, rehype, or standard multicurve initializer mode"
|
|
10964
11256
|
);
|
|
@@ -10977,14 +11269,20 @@ var DopplerFactory = class {
|
|
|
10977
11269
|
params.sale.numTokensToSell
|
|
10978
11270
|
);
|
|
10979
11271
|
const addresses = getAddresses(this.chainId);
|
|
11272
|
+
const resolvedBundler = params.devBuy ? params.modules?.bundler ?? addresses.bundler : void 0;
|
|
11273
|
+
if (params.devBuy && (!resolvedBundler || resolvedBundler === ZERO_ADDRESS)) {
|
|
11274
|
+
throw new Error(
|
|
11275
|
+
"Bundler address not configured on this chain. Override via builder.withBundler() or modules.bundler."
|
|
11276
|
+
);
|
|
11277
|
+
}
|
|
10980
11278
|
const sortedBeneficiaries = sortBeneficiaries(
|
|
10981
11279
|
params.pool.beneficiaries ?? []
|
|
10982
11280
|
);
|
|
10983
11281
|
const initializerMode = this.resolveMulticurveInitializerMode(params);
|
|
10984
11282
|
const useScheduledInitializer = initializerMode.type === "scheduled";
|
|
10985
11283
|
const useDecayInitializer = initializerMode.type === "decay";
|
|
10986
|
-
const useDopplerHookInitializer = initializerMode.type === "
|
|
10987
|
-
const normalizedRehypeHookConfig = initializerMode.type === "
|
|
11284
|
+
const useDopplerHookInitializer = initializerMode.type === "dopplerHook";
|
|
11285
|
+
const normalizedRehypeHookConfig = initializerMode.type === "dopplerHook" && initializerMode.hookConfig ? normalizeRehypeDopplerHookInitializerConfig(
|
|
10988
11286
|
initializerMode.hookConfig
|
|
10989
11287
|
) : void 0;
|
|
10990
11288
|
const curveComponents = [
|
|
@@ -11286,7 +11584,11 @@ var DopplerFactory = class {
|
|
|
11286
11584
|
),
|
|
11287
11585
|
...this.resolveGovernanceBalanceLimitExclusions(
|
|
11288
11586
|
params.governance
|
|
11289
|
-
)
|
|
11587
|
+
),
|
|
11588
|
+
...params.devBuy ? [
|
|
11589
|
+
params.devBuy.recipient,
|
|
11590
|
+
...params.devBuy.vesting.vestingDuration !== 0n && resolvedBundler ? [resolvedBundler] : []
|
|
11591
|
+
] : []
|
|
11290
11592
|
] : void 0
|
|
11291
11593
|
});
|
|
11292
11594
|
const predictedTokenAddress = this.predictDopplerERC20V1TokenAddress({
|
|
@@ -11337,29 +11639,136 @@ var DopplerFactory = class {
|
|
|
11337
11639
|
};
|
|
11338
11640
|
return createParams;
|
|
11339
11641
|
}
|
|
11642
|
+
resolveBundlerAddress(params) {
|
|
11643
|
+
const bundler = params.modules?.bundler ?? getAddresses(this.chainId).bundler;
|
|
11644
|
+
if (!bundler || bundler === ZERO_ADDRESS) {
|
|
11645
|
+
throw new Error(
|
|
11646
|
+
"Bundler address not configured on this chain. Override via builder.withBundler() or modules.bundler."
|
|
11647
|
+
);
|
|
11648
|
+
}
|
|
11649
|
+
return bundler;
|
|
11650
|
+
}
|
|
11651
|
+
async ensureDevBuyInitializerCompatibility(args) {
|
|
11652
|
+
const initializerMode = this.resolveMulticurveInitializerMode(args.params);
|
|
11653
|
+
if (initializerMode.type !== "dopplerHook") {
|
|
11654
|
+
throw new Error(
|
|
11655
|
+
"Dev buys require a DopplerHookInitializer or Rehype initializer"
|
|
11656
|
+
);
|
|
11657
|
+
}
|
|
11658
|
+
const rehypeInitializer = initializerMode.hookConfig?.hookAddress;
|
|
11659
|
+
if (!rehypeInitializer) return;
|
|
11660
|
+
const configuredBundler = await this.publicClient.readContract({
|
|
11661
|
+
address: rehypeInitializer,
|
|
11662
|
+
abi: rehypeDopplerHookInitializerAbi,
|
|
11663
|
+
functionName: "bundler"
|
|
11664
|
+
});
|
|
11665
|
+
if (configuredBundler.toLowerCase() !== args.bundler.toLowerCase()) {
|
|
11666
|
+
throw new Error(
|
|
11667
|
+
`Rehype initializer ${rehypeInitializer} is configured for Bundler ${configuredBundler}, not ${args.bundler}`
|
|
11668
|
+
);
|
|
11669
|
+
}
|
|
11670
|
+
}
|
|
11671
|
+
parseBundleSimulation(result) {
|
|
11672
|
+
const values = Array.isArray(result) ? result : result && typeof result === "object" ? [
|
|
11673
|
+
result.asset,
|
|
11674
|
+
result.poolKey,
|
|
11675
|
+
result.governance,
|
|
11676
|
+
result.timelock,
|
|
11677
|
+
result.amountOut
|
|
11678
|
+
] : [];
|
|
11679
|
+
if (values.length < 5) {
|
|
11680
|
+
throw new Error("Failed to simulate multicurve dev buy");
|
|
11681
|
+
}
|
|
11682
|
+
return {
|
|
11683
|
+
asset: values[0],
|
|
11684
|
+
poolKey: this.normalizePoolKey(values[1]),
|
|
11685
|
+
governance: values[2],
|
|
11686
|
+
timelock: values[3],
|
|
11687
|
+
amountOut: values[4]
|
|
11688
|
+
};
|
|
11689
|
+
}
|
|
11340
11690
|
async resolveFinalMulticurveCreate(args) {
|
|
11341
11691
|
const { params, simulationAccount } = args;
|
|
11342
11692
|
const addresses = getAddresses(this.chainId);
|
|
11343
11693
|
const airlock = params.modules?.airlock ?? addresses.airlock;
|
|
11344
11694
|
const initialCreateParams = args.createParams ?? this.encodeCreateMulticurveParams(params);
|
|
11345
|
-
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
|
|
11695
|
+
if (!params.devBuy) {
|
|
11696
|
+
const initialSimulation = await this.publicClient.simulateContract({
|
|
11697
|
+
address: airlock,
|
|
11698
|
+
abi: airlockAbi,
|
|
11699
|
+
functionName: "create",
|
|
11700
|
+
args: [{ ...initialCreateParams }],
|
|
11701
|
+
account: simulationAccount
|
|
11702
|
+
});
|
|
11703
|
+
const initialResult = initialSimulation.result;
|
|
11704
|
+
if (!initialResult || !Array.isArray(initialResult) || initialResult.length < 5) {
|
|
11705
|
+
throw new Error("Failed to simulate multicurve create");
|
|
11706
|
+
}
|
|
11707
|
+
let createParams2 = initialCreateParams;
|
|
11708
|
+
let request = initialSimulation.request;
|
|
11709
|
+
let result2 = initialResult;
|
|
11710
|
+
if (!args.createParams) {
|
|
11711
|
+
const enrichedCreateParams = this.withSimulationGovernanceTimelockExclusion({
|
|
11712
|
+
createParams: createParams2,
|
|
11713
|
+
simResult: initialResult,
|
|
11714
|
+
token: params.token,
|
|
11715
|
+
governance: params.governance,
|
|
11716
|
+
modules: params.modules,
|
|
11717
|
+
addresses
|
|
11718
|
+
});
|
|
11719
|
+
if (enrichedCreateParams.tokenFactoryData !== createParams2.tokenFactoryData) {
|
|
11720
|
+
createParams2 = enrichedCreateParams;
|
|
11721
|
+
const finalSimulation = await this.publicClient.simulateContract({
|
|
11722
|
+
address: airlock,
|
|
11723
|
+
abi: airlockAbi,
|
|
11724
|
+
functionName: "create",
|
|
11725
|
+
args: [{ ...createParams2 }],
|
|
11726
|
+
account: simulationAccount
|
|
11727
|
+
});
|
|
11728
|
+
const finalResult = finalSimulation.result;
|
|
11729
|
+
if (!finalResult || !Array.isArray(finalResult) || finalResult.length < 5) {
|
|
11730
|
+
throw new Error("Failed to simulate enriched multicurve create");
|
|
11731
|
+
}
|
|
11732
|
+
request = finalSimulation.request;
|
|
11733
|
+
result2 = finalResult;
|
|
11734
|
+
}
|
|
11735
|
+
}
|
|
11736
|
+
const tokenAddress = result2[0];
|
|
11737
|
+
const poolIdentity = await this.computeMulticurvePoolIdentity(
|
|
11738
|
+
params,
|
|
11739
|
+
tokenAddress
|
|
11740
|
+
);
|
|
11741
|
+
const prediction2 = {
|
|
11742
|
+
tokenAddress,
|
|
11743
|
+
poolOrHookAddress: result2[1],
|
|
11744
|
+
governanceAddress: result2[2],
|
|
11745
|
+
timelockAddress: result2[3],
|
|
11746
|
+
migrationPoolAddress: result2[4],
|
|
11747
|
+
...poolIdentity
|
|
11748
|
+
};
|
|
11749
|
+
return { airlock, createParams: createParams2, prediction: prediction2, request };
|
|
11355
11750
|
}
|
|
11751
|
+
this.validateMulticurveDevBuy(params.devBuy);
|
|
11752
|
+
const bundler = this.resolveBundlerAddress(params);
|
|
11753
|
+
await this.ensureDevBuyInitializerCompatibility({ params, bundler });
|
|
11356
11754
|
let createParams = initialCreateParams;
|
|
11357
|
-
|
|
11358
|
-
|
|
11755
|
+
const initialBundleSimulation = await this.publicClient.simulateContract({
|
|
11756
|
+
address: bundler,
|
|
11757
|
+
abi: bundlerAbi,
|
|
11758
|
+
functionName: "simulateBundle",
|
|
11759
|
+
args: [{ ...createParams }, params.devBuy.exactAmountIn]
|
|
11760
|
+
});
|
|
11761
|
+
let result = this.parseBundleSimulation(initialBundleSimulation.result);
|
|
11359
11762
|
if (!args.createParams) {
|
|
11360
11763
|
const enrichedCreateParams = this.withSimulationGovernanceTimelockExclusion({
|
|
11361
11764
|
createParams,
|
|
11362
|
-
simResult:
|
|
11765
|
+
simResult: [
|
|
11766
|
+
result.asset,
|
|
11767
|
+
result.poolKey.hooks,
|
|
11768
|
+
result.governance,
|
|
11769
|
+
result.timelock,
|
|
11770
|
+
ZERO_ADDRESS
|
|
11771
|
+
],
|
|
11363
11772
|
token: params.token,
|
|
11364
11773
|
governance: params.governance,
|
|
11365
11774
|
modules: params.modules,
|
|
@@ -11367,87 +11776,202 @@ var DopplerFactory = class {
|
|
|
11367
11776
|
});
|
|
11368
11777
|
if (enrichedCreateParams.tokenFactoryData !== createParams.tokenFactoryData) {
|
|
11369
11778
|
createParams = enrichedCreateParams;
|
|
11370
|
-
const
|
|
11371
|
-
address:
|
|
11372
|
-
abi:
|
|
11373
|
-
functionName: "
|
|
11374
|
-
args: [{ ...createParams }]
|
|
11375
|
-
account: simulationAccount
|
|
11779
|
+
const finalBundleSimulation = await this.publicClient.simulateContract({
|
|
11780
|
+
address: bundler,
|
|
11781
|
+
abi: bundlerAbi,
|
|
11782
|
+
functionName: "simulateBundle",
|
|
11783
|
+
args: [{ ...createParams }, params.devBuy.exactAmountIn]
|
|
11376
11784
|
});
|
|
11377
|
-
|
|
11378
|
-
if (!finalResult || !Array.isArray(finalResult) || finalResult.length < 5) {
|
|
11379
|
-
throw new Error("Failed to simulate enriched multicurve create");
|
|
11380
|
-
}
|
|
11381
|
-
request = finalSimulation.request;
|
|
11382
|
-
result = finalResult;
|
|
11785
|
+
result = this.parseBundleSimulation(finalBundleSimulation.result);
|
|
11383
11786
|
}
|
|
11384
11787
|
}
|
|
11385
|
-
const
|
|
11386
|
-
const
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
)
|
|
11788
|
+
const currency0 = result.poolKey.currency0.toLowerCase();
|
|
11789
|
+
const currency1 = result.poolKey.currency1.toLowerCase();
|
|
11790
|
+
const asset = result.asset.toLowerCase();
|
|
11791
|
+
const numeraire = createParams.numeraire.toLowerCase();
|
|
11792
|
+
if (!(currency0 === asset && currency1 === numeraire || currency1 === asset && currency0 === numeraire)) {
|
|
11793
|
+
throw new Error(
|
|
11794
|
+
"Bundler simulation returned a pool key that does not contain the created asset and numeraire"
|
|
11795
|
+
);
|
|
11796
|
+
}
|
|
11797
|
+
if (result.poolKey.hooks.toLowerCase() !== createParams.poolInitializer.toLowerCase()) {
|
|
11798
|
+
throw new Error(
|
|
11799
|
+
"Bundler simulation returned an unexpected pool initializer"
|
|
11800
|
+
);
|
|
11801
|
+
}
|
|
11390
11802
|
const prediction = {
|
|
11391
|
-
tokenAddress,
|
|
11392
|
-
poolOrHookAddress: result
|
|
11393
|
-
governanceAddress: result
|
|
11394
|
-
timelockAddress: result
|
|
11395
|
-
|
|
11396
|
-
|
|
11803
|
+
tokenAddress: result.asset,
|
|
11804
|
+
poolOrHookAddress: result.asset,
|
|
11805
|
+
governanceAddress: result.governance,
|
|
11806
|
+
timelockAddress: result.timelock,
|
|
11807
|
+
poolKey: result.poolKey,
|
|
11808
|
+
poolId: this.computePoolId(result.poolKey),
|
|
11809
|
+
tokenIsCurrency0: currency0 === asset
|
|
11810
|
+
};
|
|
11811
|
+
const devBuy = {
|
|
11812
|
+
...params.devBuy,
|
|
11813
|
+
vesting: { ...params.devBuy.vesting },
|
|
11814
|
+
bundler,
|
|
11815
|
+
simulatedAmountOut: result.amountOut
|
|
11397
11816
|
};
|
|
11398
|
-
return { airlock, createParams, prediction,
|
|
11817
|
+
return { airlock, bundler, createParams, prediction, devBuy };
|
|
11818
|
+
}
|
|
11819
|
+
buildDevBuyTransaction(args) {
|
|
11820
|
+
return {
|
|
11821
|
+
to: args.devBuy.bundler,
|
|
11822
|
+
data: viem.encodeFunctionData({
|
|
11823
|
+
abi: bundlerAbi,
|
|
11824
|
+
functionName: "bundle",
|
|
11825
|
+
args: [
|
|
11826
|
+
{ ...args.createParams },
|
|
11827
|
+
{ ...args.devBuy.vesting },
|
|
11828
|
+
args.devBuy.exactAmountIn,
|
|
11829
|
+
args.devBuy.recipient
|
|
11830
|
+
]
|
|
11831
|
+
}),
|
|
11832
|
+
value: args.createParams.numeraire === ZERO_ADDRESS ? args.devBuy.exactAmountIn : 0n
|
|
11833
|
+
};
|
|
11834
|
+
}
|
|
11835
|
+
async readDevBuyAllowance(args) {
|
|
11836
|
+
if (args.createParams.numeraire === ZERO_ADDRESS) {
|
|
11837
|
+
return void 0;
|
|
11838
|
+
}
|
|
11839
|
+
return await this.publicClient.readContract({
|
|
11840
|
+
address: args.createParams.numeraire,
|
|
11841
|
+
abi: viem.erc20Abi,
|
|
11842
|
+
functionName: "allowance",
|
|
11843
|
+
args: [args.account, args.bundler]
|
|
11844
|
+
});
|
|
11845
|
+
}
|
|
11846
|
+
async estimateDevBuyGas(args) {
|
|
11847
|
+
try {
|
|
11848
|
+
const gas = await this.publicClient.estimateContractGas(
|
|
11849
|
+
{
|
|
11850
|
+
address: args.devBuy.bundler,
|
|
11851
|
+
abi: bundlerAbi,
|
|
11852
|
+
functionName: "bundle",
|
|
11853
|
+
args: [
|
|
11854
|
+
{ ...args.createParams },
|
|
11855
|
+
{ ...args.devBuy.vesting },
|
|
11856
|
+
args.devBuy.exactAmountIn,
|
|
11857
|
+
args.devBuy.recipient
|
|
11858
|
+
],
|
|
11859
|
+
account: args.account,
|
|
11860
|
+
value: args.createParams.numeraire === ZERO_ADDRESS ? args.devBuy.exactAmountIn : 0n
|
|
11861
|
+
}
|
|
11862
|
+
);
|
|
11863
|
+
return { status: "estimated", gas };
|
|
11864
|
+
} catch {
|
|
11865
|
+
return { status: "unavailable" };
|
|
11866
|
+
}
|
|
11399
11867
|
}
|
|
11400
11868
|
async prepareCreateMulticurve(params, options) {
|
|
11401
11869
|
const resolved = await this.resolveFinalMulticurveCreate({
|
|
11402
11870
|
params,
|
|
11403
11871
|
simulationAccount: options.account
|
|
11404
11872
|
});
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11873
|
+
if (!resolved.devBuy) {
|
|
11874
|
+
const internalGasEstimate = await this.resolveInternalCreateGasEstimate({
|
|
11875
|
+
request: resolved.request,
|
|
11876
|
+
address: resolved.airlock,
|
|
11877
|
+
createParams: resolved.createParams,
|
|
11878
|
+
account: options.account
|
|
11879
|
+
});
|
|
11880
|
+
if (internalGasEstimate.status === "reverted") {
|
|
11881
|
+
throw internalGasEstimate.error;
|
|
11882
|
+
}
|
|
11883
|
+
return {
|
|
11884
|
+
chainId: this.chainId,
|
|
11885
|
+
account: options.account,
|
|
11886
|
+
airlock: resolved.airlock,
|
|
11887
|
+
createParams: resolved.createParams,
|
|
11888
|
+
prediction: resolved.prediction,
|
|
11889
|
+
transaction: {
|
|
11890
|
+
to: resolved.airlock,
|
|
11891
|
+
data: viem.encodeFunctionData({
|
|
11892
|
+
abi: airlockAbi,
|
|
11893
|
+
functionName: "create",
|
|
11894
|
+
args: [{ ...resolved.createParams }]
|
|
11895
|
+
}),
|
|
11896
|
+
value: 0n
|
|
11897
|
+
},
|
|
11898
|
+
gasEstimate: internalGasEstimate
|
|
11899
|
+
};
|
|
11900
|
+
}
|
|
11901
|
+
const allowance = await this.readDevBuyAllowance({
|
|
11902
|
+
createParams: resolved.createParams,
|
|
11903
|
+
account: options.account,
|
|
11904
|
+
bundler: resolved.devBuy.bundler
|
|
11905
|
+
});
|
|
11906
|
+
const approvalRequired = allowance !== void 0 && allowance < resolved.devBuy.exactAmountIn;
|
|
11907
|
+
const approvalTransaction = approvalRequired ? {
|
|
11908
|
+
to: resolved.createParams.numeraire,
|
|
11909
|
+
data: viem.encodeFunctionData({
|
|
11910
|
+
abi: viem.erc20Abi,
|
|
11911
|
+
functionName: "approve",
|
|
11912
|
+
args: [resolved.devBuy.bundler, resolved.devBuy.exactAmountIn]
|
|
11913
|
+
}),
|
|
11914
|
+
value: 0n
|
|
11915
|
+
} : void 0;
|
|
11916
|
+
const gasEstimate = approvalRequired ? { status: "unavailable" } : await this.estimateDevBuyGas({
|
|
11408
11917
|
createParams: resolved.createParams,
|
|
11918
|
+
devBuy: resolved.devBuy,
|
|
11409
11919
|
account: options.account
|
|
11410
11920
|
});
|
|
11411
|
-
if (internalGasEstimate.status === "reverted") {
|
|
11412
|
-
throw internalGasEstimate.error;
|
|
11413
|
-
}
|
|
11414
|
-
const gasEstimate = internalGasEstimate;
|
|
11415
11921
|
return {
|
|
11416
11922
|
chainId: this.chainId,
|
|
11417
11923
|
account: options.account,
|
|
11418
11924
|
airlock: resolved.airlock,
|
|
11419
11925
|
createParams: resolved.createParams,
|
|
11420
11926
|
prediction: resolved.prediction,
|
|
11421
|
-
transaction: {
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
}),
|
|
11428
|
-
value: 0n
|
|
11429
|
-
},
|
|
11927
|
+
transaction: this.buildDevBuyTransaction({
|
|
11928
|
+
createParams: resolved.createParams,
|
|
11929
|
+
devBuy: resolved.devBuy
|
|
11930
|
+
}),
|
|
11931
|
+
approvalTransaction,
|
|
11932
|
+
devBuy: resolved.devBuy,
|
|
11430
11933
|
gasEstimate
|
|
11431
11934
|
};
|
|
11432
11935
|
}
|
|
11433
11936
|
async simulateCreateMulticurve(params) {
|
|
11937
|
+
const paramsSnapshot = structuredClone(params);
|
|
11434
11938
|
const resolved = await this.resolveFinalMulticurveCreate({
|
|
11435
|
-
params,
|
|
11939
|
+
params: paramsSnapshot,
|
|
11436
11940
|
simulationAccount: this.walletClient?.account
|
|
11437
11941
|
});
|
|
11438
|
-
const
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11942
|
+
const createParamsSnapshot = structuredClone(resolved.createParams);
|
|
11943
|
+
let gasEstimate;
|
|
11944
|
+
if (resolved.devBuy) {
|
|
11945
|
+
const account = this.walletClient?.account ?? paramsSnapshot.userAddress;
|
|
11946
|
+
const allowance = await this.readDevBuyAllowance({
|
|
11947
|
+
createParams: resolved.createParams,
|
|
11948
|
+
account: typeof account === "string" ? account : account.address,
|
|
11949
|
+
bundler: resolved.devBuy.bundler
|
|
11950
|
+
});
|
|
11951
|
+
if (allowance === void 0 || allowance >= resolved.devBuy.exactAmountIn) {
|
|
11952
|
+
const estimate = await this.estimateDevBuyGas({
|
|
11953
|
+
createParams: resolved.createParams,
|
|
11954
|
+
devBuy: resolved.devBuy,
|
|
11955
|
+
account
|
|
11956
|
+
});
|
|
11957
|
+
gasEstimate = estimate.status === "estimated" ? estimate.gas : void 0;
|
|
11958
|
+
}
|
|
11959
|
+
} else {
|
|
11960
|
+
gasEstimate = await this.resolveCreateGasEstimate({
|
|
11961
|
+
request: resolved.request,
|
|
11962
|
+
address: resolved.airlock,
|
|
11963
|
+
createParams: resolved.createParams,
|
|
11964
|
+
account: this.walletClient?.account ?? paramsSnapshot.userAddress
|
|
11965
|
+
});
|
|
11966
|
+
}
|
|
11444
11967
|
return {
|
|
11445
11968
|
createParams: resolved.createParams,
|
|
11446
11969
|
tokenAddress: resolved.prediction.tokenAddress,
|
|
11447
11970
|
poolId: resolved.prediction.poolId,
|
|
11448
11971
|
gasEstimate,
|
|
11449
|
-
|
|
11450
|
-
|
|
11972
|
+
devBuy: resolved.devBuy,
|
|
11973
|
+
execute: () => this.createMulticurve(paramsSnapshot, {
|
|
11974
|
+
_createParams: createParamsSnapshot
|
|
11451
11975
|
})
|
|
11452
11976
|
};
|
|
11453
11977
|
}
|
|
@@ -11460,38 +11984,142 @@ var DopplerFactory = class {
|
|
|
11460
11984
|
simulationAccount: this.walletClient.account,
|
|
11461
11985
|
createParams: options?._createParams
|
|
11462
11986
|
});
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11987
|
+
let approvalTransactionHash;
|
|
11988
|
+
let hash;
|
|
11989
|
+
if (resolved.devBuy) {
|
|
11990
|
+
const account2 = this.walletClient.account;
|
|
11991
|
+
if (!account2) {
|
|
11992
|
+
throw new Error("Wallet account required for write operations");
|
|
11993
|
+
}
|
|
11994
|
+
const accountAddress2 = typeof account2 === "string" ? account2 : account2.address;
|
|
11995
|
+
const [allowance, balance] = await Promise.all([
|
|
11996
|
+
this.readDevBuyAllowance({
|
|
11997
|
+
createParams: resolved.createParams,
|
|
11998
|
+
account: accountAddress2,
|
|
11999
|
+
bundler: resolved.devBuy.bundler
|
|
12000
|
+
}),
|
|
12001
|
+
resolved.createParams.numeraire === ZERO_ADDRESS ? void 0 : this.publicClient.readContract({
|
|
12002
|
+
address: resolved.createParams.numeraire,
|
|
12003
|
+
abi: viem.erc20Abi,
|
|
12004
|
+
functionName: "balanceOf",
|
|
12005
|
+
args: [accountAddress2]
|
|
12006
|
+
})
|
|
12007
|
+
]);
|
|
12008
|
+
if (balance !== void 0 && balance < resolved.devBuy.exactAmountIn) {
|
|
12009
|
+
throw new Error(
|
|
12010
|
+
`Insufficient ERC20 balance for dev buy: required ${resolved.devBuy.exactAmountIn}, available ${balance}`
|
|
12011
|
+
);
|
|
12012
|
+
}
|
|
12013
|
+
if (allowance !== void 0 && allowance < resolved.devBuy.exactAmountIn) {
|
|
12014
|
+
const { request: approvalRequest, result: approvalSucceeded } = await this.publicClient.simulateContract({
|
|
12015
|
+
address: resolved.createParams.numeraire,
|
|
12016
|
+
abi: viem.erc20Abi,
|
|
12017
|
+
functionName: "approve",
|
|
12018
|
+
args: [resolved.devBuy.bundler, resolved.devBuy.exactAmountIn],
|
|
12019
|
+
account: account2
|
|
12020
|
+
});
|
|
12021
|
+
if (approvalSucceeded !== true) {
|
|
12022
|
+
throw new Error("Bundler approval simulation returned false");
|
|
12023
|
+
}
|
|
12024
|
+
approvalTransactionHash = await this.walletClient.writeContract(approvalRequest);
|
|
12025
|
+
const approvalReceipt = await this.publicClient.waitForTransactionReceipt({
|
|
12026
|
+
hash: approvalTransactionHash,
|
|
12027
|
+
confirmations: 2
|
|
12028
|
+
});
|
|
12029
|
+
if (approvalReceipt.status !== "success") {
|
|
12030
|
+
throw new Error("Bundler approval transaction reverted");
|
|
12031
|
+
}
|
|
12032
|
+
const approvedAllowance = await this.readDevBuyAllowance({
|
|
12033
|
+
createParams: resolved.createParams,
|
|
12034
|
+
account: accountAddress2,
|
|
12035
|
+
bundler: resolved.devBuy.bundler
|
|
12036
|
+
});
|
|
12037
|
+
if (approvedAllowance === void 0 || approvedAllowance < resolved.devBuy.exactAmountIn) {
|
|
12038
|
+
throw new Error(
|
|
12039
|
+
"Bundler approval transaction did not provide the required allowance"
|
|
12040
|
+
);
|
|
12041
|
+
}
|
|
12042
|
+
}
|
|
12043
|
+
const { request } = await this.publicClient.simulateContract({
|
|
12044
|
+
address: resolved.devBuy.bundler,
|
|
12045
|
+
abi: bundlerAbi,
|
|
12046
|
+
functionName: "bundle",
|
|
12047
|
+
args: [
|
|
12048
|
+
{ ...resolved.createParams },
|
|
12049
|
+
{ ...resolved.devBuy.vesting },
|
|
12050
|
+
resolved.devBuy.exactAmountIn,
|
|
12051
|
+
resolved.devBuy.recipient
|
|
12052
|
+
],
|
|
12053
|
+
account: account2,
|
|
12054
|
+
value: resolved.createParams.numeraire === ZERO_ADDRESS ? resolved.devBuy.exactAmountIn : 0n
|
|
12055
|
+
});
|
|
12056
|
+
hash = await this.walletClient.writeContract(
|
|
12057
|
+
params.gas === void 0 ? request : { ...request, gas: params.gas }
|
|
12058
|
+
);
|
|
12059
|
+
} else {
|
|
12060
|
+
const gasEstimate = await this.resolveCreateGasEstimate({
|
|
12061
|
+
request: resolved.request,
|
|
12062
|
+
address: resolved.airlock,
|
|
12063
|
+
createParams: resolved.createParams,
|
|
12064
|
+
account: this.walletClient.account
|
|
12065
|
+
});
|
|
12066
|
+
const gas = params.gas ?? gasEstimate ?? DEFAULT_CREATE_GAS_LIMIT;
|
|
12067
|
+
hash = await this.walletClient.writeContract({
|
|
12068
|
+
...resolved.request,
|
|
12069
|
+
gas
|
|
12070
|
+
});
|
|
12071
|
+
}
|
|
12072
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash, confirmations: 2 });
|
|
12073
|
+
const account = this.walletClient.account;
|
|
12074
|
+
if (!account) {
|
|
12075
|
+
throw new Error("Wallet account required for receipt verification");
|
|
12076
|
+
}
|
|
12077
|
+
const accountAddress = typeof account === "string" ? account : account.address;
|
|
12078
|
+
const transaction = resolved.devBuy ? this.buildDevBuyTransaction({
|
|
12079
|
+
createParams: resolved.createParams,
|
|
12080
|
+
devBuy: resolved.devBuy
|
|
12081
|
+
}) : {
|
|
12082
|
+
to: resolved.airlock,
|
|
12083
|
+
data: viem.encodeFunctionData({
|
|
12084
|
+
abi: airlockAbi,
|
|
12085
|
+
functionName: "create",
|
|
12086
|
+
args: [{ ...resolved.createParams }]
|
|
12087
|
+
}),
|
|
12088
|
+
value: 0n
|
|
12089
|
+
};
|
|
12090
|
+
const prepared = {
|
|
12091
|
+
chainId: this.chainId,
|
|
12092
|
+
account: accountAddress,
|
|
12093
|
+
airlock: resolved.airlock,
|
|
11466
12094
|
createParams: resolved.createParams,
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
const
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
if (!createResult) {
|
|
11480
|
-
throw new Error(
|
|
11481
|
-
"Failed to extract token address from Create event in transaction logs"
|
|
11482
|
-
);
|
|
12095
|
+
prediction: resolved.prediction,
|
|
12096
|
+
transaction,
|
|
12097
|
+
devBuy: resolved.devBuy};
|
|
12098
|
+
const verified = verifyPreparedCreateReceipt({ prepared, receipt });
|
|
12099
|
+
const baseResult = {
|
|
12100
|
+
tokenAddress: verified.receiptIdentity.tokenAddress,
|
|
12101
|
+
poolId: resolved.prediction.poolId,
|
|
12102
|
+
transactionHash: hash,
|
|
12103
|
+
approvalTransactionHash
|
|
12104
|
+
};
|
|
12105
|
+
if (!resolved.devBuy) {
|
|
12106
|
+
return baseResult;
|
|
11483
12107
|
}
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
`[DopplerSDK] Simulation predicted token ${resolved.prediction.tokenAddress} but actual is ${actualTokenAddress}. This may indicate state divergence between simulation and execution.`
|
|
12108
|
+
if (!verified.devBuy) {
|
|
12109
|
+
throw new Error(
|
|
12110
|
+
"Bundler receipt verification did not return dev-buy data"
|
|
11488
12111
|
);
|
|
11489
12112
|
}
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
|
|
12113
|
+
return {
|
|
12114
|
+
...baseResult,
|
|
12115
|
+
devBuy: {
|
|
12116
|
+
exactAmountIn: resolved.devBuy.exactAmountIn,
|
|
12117
|
+
recipient: resolved.devBuy.recipient,
|
|
12118
|
+
vesting: { ...resolved.devBuy.vesting },
|
|
12119
|
+
bundler: resolved.devBuy.bundler,
|
|
12120
|
+
amountOut: verified.devBuy.amountOut
|
|
12121
|
+
}
|
|
12122
|
+
};
|
|
11495
12123
|
}
|
|
11496
12124
|
/**
|
|
11497
12125
|
* Normalize user-provided multicurve positions and ensure they satisfy SDK constraints
|
|
@@ -11992,6 +12620,24 @@ var DopplerFactory = class {
|
|
|
11992
12620
|
);
|
|
11993
12621
|
}
|
|
11994
12622
|
}
|
|
12623
|
+
validateMulticurveDevBuy(devBuy) {
|
|
12624
|
+
if (devBuy.exactAmountIn <= 0n || devBuy.exactAmountIn > MAX_UINT128) {
|
|
12625
|
+
throw new Error("Dev buy exactAmountIn must be in the uint128 range");
|
|
12626
|
+
}
|
|
12627
|
+
if (devBuy.recipient.toLowerCase() === ZERO_ADDRESS) {
|
|
12628
|
+
throw new Error("Dev buy recipient must not be the zero address");
|
|
12629
|
+
}
|
|
12630
|
+
const { vestingDuration, cliffDuration } = devBuy.vesting;
|
|
12631
|
+
if (vestingDuration < 0n || vestingDuration > MAX_UINT64 || cliffDuration < 0n || cliffDuration > MAX_UINT64) {
|
|
12632
|
+
throw new Error("Dev buy vesting durations must be in the uint64 range");
|
|
12633
|
+
}
|
|
12634
|
+
if (vestingDuration !== 0n && vestingDuration < MIN_BUNDLER_VESTING_DURATION) {
|
|
12635
|
+
throw new Error("Dev buy vestingDuration must be at least 86400 seconds");
|
|
12636
|
+
}
|
|
12637
|
+
if (cliffDuration > vestingDuration) {
|
|
12638
|
+
throw new Error("Dev buy cliffDuration must not exceed vestingDuration");
|
|
12639
|
+
}
|
|
12640
|
+
}
|
|
11995
12641
|
/**
|
|
11996
12642
|
* Validate multicurve auction parameters
|
|
11997
12643
|
*/
|
|
@@ -12015,6 +12661,14 @@ var DopplerFactory = class {
|
|
|
12015
12661
|
throw new Error("Cannot sell more tokens than initial supply");
|
|
12016
12662
|
}
|
|
12017
12663
|
this.resolveMulticurveInitializerMode(params);
|
|
12664
|
+
if (params.devBuy) {
|
|
12665
|
+
this.validateMulticurveDevBuy(params.devBuy);
|
|
12666
|
+
if (this.resolveMulticurveInitializerMode(params).type !== "dopplerHook") {
|
|
12667
|
+
throw new Error(
|
|
12668
|
+
"Dev buys require a DopplerHookInitializer or Rehype initializer"
|
|
12669
|
+
);
|
|
12670
|
+
}
|
|
12671
|
+
}
|
|
12018
12672
|
this.validateVestingConfig(params.sale, params.vesting);
|
|
12019
12673
|
if (params.pool.beneficiaries && params.pool.beneficiaries.length > 0) {
|
|
12020
12674
|
const beneficiaries = params.pool.beneficiaries;
|
|
@@ -12059,18 +12713,6 @@ var DopplerFactory = class {
|
|
|
12059
12713
|
);
|
|
12060
12714
|
}
|
|
12061
12715
|
}
|
|
12062
|
-
/**
|
|
12063
|
-
* Get the Bundler contract address for the current chain
|
|
12064
|
-
* Used to perform atomic create + swap ("bundle") flows for static auctions
|
|
12065
|
-
*/
|
|
12066
|
-
getBundlerAddress() {
|
|
12067
|
-
const addresses = getAddresses(this.chainId);
|
|
12068
|
-
const addr = addresses.bundler;
|
|
12069
|
-
if (!addr || addr === ZERO_ADDRESS) {
|
|
12070
|
-
throw new Error("Bundler address not configured for this chain");
|
|
12071
|
-
}
|
|
12072
|
-
return addr;
|
|
12073
|
-
}
|
|
12074
12716
|
/**
|
|
12075
12717
|
* Get the appropriate migrator address based on migration config
|
|
12076
12718
|
* Allows override via ModuleAddressOverrides when provided in params.
|
|
@@ -12146,168 +12788,6 @@ var DopplerFactory = class {
|
|
|
12146
12788
|
}
|
|
12147
12789
|
// computeTicks moved to builders. No longer needed here.
|
|
12148
12790
|
// computeOptimalGamma moved to utils.
|
|
12149
|
-
// -----------------------------
|
|
12150
|
-
// Bundler helpers (Static/V3)
|
|
12151
|
-
// -----------------------------
|
|
12152
|
-
/**
|
|
12153
|
-
* Simulate a bundle with exact input on Uniswap V3 as part of create
|
|
12154
|
-
* Returns the expected output amount for the provided exact input.
|
|
12155
|
-
*/
|
|
12156
|
-
async simulateBundleExactInput(createParams, params) {
|
|
12157
|
-
const bundler = this.getBundlerAddress();
|
|
12158
|
-
const { result } = await this.publicClient.simulateContract({
|
|
12159
|
-
address: bundler,
|
|
12160
|
-
abi: bundlerAbi,
|
|
12161
|
-
functionName: "simulateBundleExactIn",
|
|
12162
|
-
args: [
|
|
12163
|
-
{ ...createParams },
|
|
12164
|
-
{
|
|
12165
|
-
tokenIn: params.tokenIn,
|
|
12166
|
-
tokenOut: params.tokenOut,
|
|
12167
|
-
amountIn: params.amountIn,
|
|
12168
|
-
fee: params.fee,
|
|
12169
|
-
sqrtPriceLimitX96: params.sqrtPriceLimitX96
|
|
12170
|
-
}
|
|
12171
|
-
]
|
|
12172
|
-
});
|
|
12173
|
-
return result;
|
|
12174
|
-
}
|
|
12175
|
-
/**
|
|
12176
|
-
* Simulate a bundle with exact output on Uniswap V3 as part of create
|
|
12177
|
-
* Returns the required input amount for the provided exact output.
|
|
12178
|
-
*/
|
|
12179
|
-
async simulateBundleExactOutput(createParams, params) {
|
|
12180
|
-
const bundler = this.getBundlerAddress();
|
|
12181
|
-
const { result } = await this.publicClient.simulateContract({
|
|
12182
|
-
address: bundler,
|
|
12183
|
-
abi: bundlerAbi,
|
|
12184
|
-
functionName: "simulateBundleExactOut",
|
|
12185
|
-
args: [
|
|
12186
|
-
{ ...createParams },
|
|
12187
|
-
{
|
|
12188
|
-
tokenIn: params.tokenIn,
|
|
12189
|
-
tokenOut: params.tokenOut,
|
|
12190
|
-
amount: params.amount,
|
|
12191
|
-
fee: params.fee,
|
|
12192
|
-
sqrtPriceLimitX96: params.sqrtPriceLimitX96
|
|
12193
|
-
}
|
|
12194
|
-
]
|
|
12195
|
-
});
|
|
12196
|
-
return result;
|
|
12197
|
-
}
|
|
12198
|
-
// Bundler helpers (Multicurve/V4)
|
|
12199
|
-
async simulateMulticurveBundleExactOut(createParams, params) {
|
|
12200
|
-
const bundler = this.getBundlerAddress();
|
|
12201
|
-
await this.ensureMulticurveBundlerSupport(bundler);
|
|
12202
|
-
const exactAmountOut = params?.exactAmountOut ?? 0n;
|
|
12203
|
-
this.ensureUint128(exactAmountOut, "exactAmountOut", { allowZero: true });
|
|
12204
|
-
const hookData = "0x";
|
|
12205
|
-
const { result } = await this.publicClient.simulateContract({
|
|
12206
|
-
address: bundler,
|
|
12207
|
-
abi: bundlerAbi,
|
|
12208
|
-
functionName: "simulateMulticurveBundleExactOut",
|
|
12209
|
-
args: [{ ...createParams }, exactAmountOut, hookData]
|
|
12210
|
-
});
|
|
12211
|
-
const { asset, poolKey, amount, gasEstimate } = this.parseMulticurveBundleResult(result);
|
|
12212
|
-
return {
|
|
12213
|
-
asset,
|
|
12214
|
-
poolKey,
|
|
12215
|
-
amountIn: amount,
|
|
12216
|
-
gasEstimate
|
|
12217
|
-
};
|
|
12218
|
-
}
|
|
12219
|
-
async simulateMulticurveBundleExactIn(createParams, params) {
|
|
12220
|
-
const bundler = this.getBundlerAddress();
|
|
12221
|
-
await this.ensureMulticurveBundlerSupport(bundler);
|
|
12222
|
-
if (params.exactAmountIn === void 0) {
|
|
12223
|
-
throw new Error(
|
|
12224
|
-
"exactAmountIn is required for multicurve bundle simulations"
|
|
12225
|
-
);
|
|
12226
|
-
}
|
|
12227
|
-
const exactAmountIn = params.exactAmountIn;
|
|
12228
|
-
this.ensureUint128(exactAmountIn, "exactAmountIn");
|
|
12229
|
-
const hookData = "0x";
|
|
12230
|
-
const { result } = await this.publicClient.simulateContract({
|
|
12231
|
-
address: bundler,
|
|
12232
|
-
abi: bundlerAbi,
|
|
12233
|
-
functionName: "simulateMulticurveBundleExactIn",
|
|
12234
|
-
args: [{ ...createParams }, exactAmountIn, hookData]
|
|
12235
|
-
});
|
|
12236
|
-
const { asset, poolKey, amount, gasEstimate } = this.parseMulticurveBundleResult(result);
|
|
12237
|
-
return {
|
|
12238
|
-
asset,
|
|
12239
|
-
poolKey,
|
|
12240
|
-
amountOut: amount,
|
|
12241
|
-
gasEstimate
|
|
12242
|
-
};
|
|
12243
|
-
}
|
|
12244
|
-
/**
|
|
12245
|
-
* Execute an atomic create + swap bundle through the Bundler
|
|
12246
|
-
* commands/inputs are Universal Router encoded values (e.g., from doppler-router)
|
|
12247
|
-
*/
|
|
12248
|
-
async bundle(createParams, commands, inputs, options) {
|
|
12249
|
-
if (!this.walletClient) {
|
|
12250
|
-
throw new Error("Wallet client required for write operations");
|
|
12251
|
-
}
|
|
12252
|
-
const bundler = this.getBundlerAddress();
|
|
12253
|
-
const { request } = await this.publicClient.simulateContract({
|
|
12254
|
-
address: bundler,
|
|
12255
|
-
abi: bundlerAbi,
|
|
12256
|
-
functionName: "bundle",
|
|
12257
|
-
args: [{ ...createParams }, commands, inputs],
|
|
12258
|
-
account: this.walletClient.account,
|
|
12259
|
-
value: options?.value ?? 0n
|
|
12260
|
-
});
|
|
12261
|
-
const gas = options?.gas ?? void 0;
|
|
12262
|
-
const tx = await this.walletClient.writeContract(
|
|
12263
|
-
gas ? { ...request, gas } : request
|
|
12264
|
-
);
|
|
12265
|
-
return tx;
|
|
12266
|
-
}
|
|
12267
|
-
ensureUint128(value, paramName, options = {}) {
|
|
12268
|
-
const { allowZero = false } = options;
|
|
12269
|
-
if (value < 0n) {
|
|
12270
|
-
throw new Error(`${paramName} cannot be negative`);
|
|
12271
|
-
}
|
|
12272
|
-
if (!allowZero && value === 0n) {
|
|
12273
|
-
throw new Error(`${paramName} must be greater than zero`);
|
|
12274
|
-
}
|
|
12275
|
-
if (value > MAX_UINT1282) {
|
|
12276
|
-
throw new Error(`${paramName} exceeds uint128 range`);
|
|
12277
|
-
}
|
|
12278
|
-
}
|
|
12279
|
-
parseMulticurveBundleResult(result) {
|
|
12280
|
-
let asset;
|
|
12281
|
-
let poolKeyRaw;
|
|
12282
|
-
let amount;
|
|
12283
|
-
let gasEstimate;
|
|
12284
|
-
if (Array.isArray(result)) {
|
|
12285
|
-
if (result.length < 4) {
|
|
12286
|
-
throw new Error("Unexpected multicurve bundle simulation result shape");
|
|
12287
|
-
}
|
|
12288
|
-
asset = result[0];
|
|
12289
|
-
poolKeyRaw = result[1];
|
|
12290
|
-
amount = result[2];
|
|
12291
|
-
gasEstimate = result[3];
|
|
12292
|
-
} else if (result && typeof result === "object") {
|
|
12293
|
-
const obj = result;
|
|
12294
|
-
asset = obj.asset;
|
|
12295
|
-
poolKeyRaw = obj.poolKey;
|
|
12296
|
-
amount = obj.amountIn ?? obj.amountOut ?? obj.amount;
|
|
12297
|
-
gasEstimate = obj.gasEstimate;
|
|
12298
|
-
} else {
|
|
12299
|
-
throw new Error("Unexpected multicurve bundle simulation result format");
|
|
12300
|
-
}
|
|
12301
|
-
if (asset === void 0 || poolKeyRaw === void 0 || amount === void 0 || gasEstimate === void 0) {
|
|
12302
|
-
throw new Error("Incomplete multicurve bundle simulation result");
|
|
12303
|
-
}
|
|
12304
|
-
return {
|
|
12305
|
-
asset,
|
|
12306
|
-
poolKey: this.normalizePoolKey(poolKeyRaw),
|
|
12307
|
-
amount,
|
|
12308
|
-
gasEstimate
|
|
12309
|
-
};
|
|
12310
|
-
}
|
|
12311
12791
|
normalizePoolKey(value) {
|
|
12312
12792
|
if (Array.isArray(value)) {
|
|
12313
12793
|
const [currency0, currency1, feeRaw, tickSpacingRaw, hooks] = value;
|
|
@@ -12677,7 +13157,7 @@ var DopplerFactory = class {
|
|
|
12677
13157
|
const addresses = getAddresses(this.chainId);
|
|
12678
13158
|
const initializerMode = this.resolveMulticurveInitializerMode(params);
|
|
12679
13159
|
let hookAddress;
|
|
12680
|
-
if (initializerMode.type === "
|
|
13160
|
+
if (initializerMode.type === "dopplerHook") {
|
|
12681
13161
|
hookAddress = params.modules?.dopplerHookInitializer ?? addresses.dopplerHookInitializer ?? ZERO_ADDRESS;
|
|
12682
13162
|
if (hookAddress === ZERO_ADDRESS) {
|
|
12683
13163
|
throw new Error("DopplerHookInitializer address not configured");
|
|
@@ -12706,7 +13186,7 @@ var DopplerFactory = class {
|
|
|
12706
13186
|
const poolKey = {
|
|
12707
13187
|
currency0: tokenIsCurrency0 ? tokenAddress : numeraire,
|
|
12708
13188
|
currency1: tokenIsCurrency0 ? numeraire : tokenAddress,
|
|
12709
|
-
fee: initializerMode.type === "decay" || initializerMode.type === "
|
|
13189
|
+
fee: initializerMode.type === "decay" || initializerMode.type === "dopplerHook" && initializerMode.hookConfig ? DYNAMIC_FEE_FLAG : params.pool.fee,
|
|
12710
13190
|
tickSpacing: params.pool.tickSpacing,
|
|
12711
13191
|
hooks: hookAddress
|
|
12712
13192
|
};
|
|
@@ -12716,30 +13196,7 @@ var DopplerFactory = class {
|
|
|
12716
13196
|
tokenIsCurrency0
|
|
12717
13197
|
};
|
|
12718
13198
|
}
|
|
12719
|
-
async ensureMulticurveBundlerSupport(bundler) {
|
|
12720
|
-
if (this.multicurveBundlerSupport.get(bundler)) {
|
|
12721
|
-
return;
|
|
12722
|
-
}
|
|
12723
|
-
const client = this.publicClient;
|
|
12724
|
-
if (!client || typeof client.getBytecode !== "function") {
|
|
12725
|
-
this.multicurveBundlerSupport.set(bundler, true);
|
|
12726
|
-
return;
|
|
12727
|
-
}
|
|
12728
|
-
const bytecode = await client.getBytecode({ address: bundler });
|
|
12729
|
-
const supports = Boolean(
|
|
12730
|
-
bytecode && MULTICURVE_BUNDLER_SELECTORS.every(
|
|
12731
|
-
(selector) => bytecode.includes(selector.slice(2))
|
|
12732
|
-
)
|
|
12733
|
-
);
|
|
12734
|
-
if (!supports) {
|
|
12735
|
-
throw new Error(
|
|
12736
|
-
`Bundler at ${bundler} does not support multicurve bundling. Ensure the Doppler Bundler has been upgraded and update chain addresses.`
|
|
12737
|
-
);
|
|
12738
|
-
}
|
|
12739
|
-
this.multicurveBundlerSupport.set(bundler, true);
|
|
12740
|
-
}
|
|
12741
13199
|
};
|
|
12742
|
-
var MULTICURVE_BUNDLER_SELECTORS = ["0xe2e9faa1", "0x07087b06"];
|
|
12743
13200
|
function parseAirlockPoolOrHook(rawAssetData, context = "Airlock getAssetData") {
|
|
12744
13201
|
const rawPoolOrHook = readContractResultField(
|
|
12745
13202
|
rawAssetData,
|
|
@@ -13165,12 +13622,12 @@ var DynamicAuction = class {
|
|
|
13165
13622
|
const isToken0 = poolKey.currency0 !== viem.zeroAddress;
|
|
13166
13623
|
const tokenAddress = isToken0 ? poolKey.currency0 : poolKey.currency1;
|
|
13167
13624
|
const numeraireAddress = isToken0 ? poolKey.currency1 : poolKey.currency0;
|
|
13168
|
-
const
|
|
13625
|
+
const poolId2 = computePoolId(poolKey);
|
|
13169
13626
|
return {
|
|
13170
13627
|
hookAddress: this.hookAddress,
|
|
13171
13628
|
tokenAddress,
|
|
13172
13629
|
numeraireAddress,
|
|
13173
|
-
poolId,
|
|
13630
|
+
poolId: poolId2,
|
|
13174
13631
|
currentEpoch,
|
|
13175
13632
|
totalProceeds: state.totalProceeds,
|
|
13176
13633
|
totalTokensSold: state.totalTokensSold,
|
|
@@ -13493,14 +13950,14 @@ async function collectMulticurveFees({
|
|
|
13493
13950
|
addresses
|
|
13494
13951
|
}) {
|
|
13495
13952
|
if (state.status === 2 /* Locked */) {
|
|
13496
|
-
const
|
|
13953
|
+
const poolId2 = computePoolId(state.poolKey);
|
|
13497
13954
|
const collectFeesAbi = initializerAddress === addresses.dopplerHookInitializer ? dopplerHookInitializerAbi : v4MulticurveInitializerAbi;
|
|
13498
13955
|
return collectFeesFromContract({
|
|
13499
13956
|
client,
|
|
13500
13957
|
walletClient,
|
|
13501
13958
|
contractAddress: initializerAddress,
|
|
13502
13959
|
abi: collectFeesAbi,
|
|
13503
|
-
poolId
|
|
13960
|
+
poolId: poolId2
|
|
13504
13961
|
});
|
|
13505
13962
|
}
|
|
13506
13963
|
throw new Error("Multicurve pool is not locked or was migrated");
|
|
@@ -13510,13 +13967,13 @@ async function collectFeesFromContract({
|
|
|
13510
13967
|
walletClient,
|
|
13511
13968
|
contractAddress,
|
|
13512
13969
|
abi,
|
|
13513
|
-
poolId
|
|
13970
|
+
poolId: poolId2
|
|
13514
13971
|
}) {
|
|
13515
13972
|
const { request, result } = await client.simulateContract({
|
|
13516
13973
|
address: contractAddress,
|
|
13517
13974
|
abi,
|
|
13518
13975
|
functionName: "collectFees",
|
|
13519
|
-
args: [
|
|
13976
|
+
args: [poolId2],
|
|
13520
13977
|
account: walletClient.account
|
|
13521
13978
|
});
|
|
13522
13979
|
const hash = await walletClient.writeContract(request);
|
|
@@ -13532,13 +13989,13 @@ async function getMulticurveFeeSchedule(client, state) {
|
|
|
13532
13989
|
if (state.poolKey.fee !== DYNAMIC_FEE_FLAG) {
|
|
13533
13990
|
return null;
|
|
13534
13991
|
}
|
|
13535
|
-
const
|
|
13992
|
+
const poolId2 = computePoolId(state.poolKey);
|
|
13536
13993
|
try {
|
|
13537
13994
|
const scheduleData = await client.readContract({
|
|
13538
13995
|
address: state.poolKey.hooks,
|
|
13539
13996
|
abi: decayMulticurveInitializerHookAbi,
|
|
13540
13997
|
functionName: "getFeeScheduleOf",
|
|
13541
|
-
args: [
|
|
13998
|
+
args: [poolId2]
|
|
13542
13999
|
});
|
|
13543
14000
|
return {
|
|
13544
14001
|
startingTime: Number(readStructField(scheduleData, "startingTime", 0)),
|
|
@@ -13614,14 +14071,14 @@ var PENDING_FEE_CALL_ORDER = [
|
|
|
13614
14071
|
"getLastCumulatedFees1"
|
|
13615
14072
|
];
|
|
13616
14073
|
var PENDING_FEE_PREVIEW_CALL_COUNT = PENDING_FEE_CALL_ORDER.length;
|
|
13617
|
-
function createPendingFeePreviewCalls(target,
|
|
14074
|
+
function createPendingFeePreviewCalls(target, poolId2, beneficiary) {
|
|
13618
14075
|
return PENDING_FEE_CALL_ORDER.map((functionName) => ({
|
|
13619
14076
|
target,
|
|
13620
14077
|
allowFailure: true,
|
|
13621
14078
|
callData: viem.encodeFunctionData({
|
|
13622
14079
|
abi: feeClaimsInitializerAbi,
|
|
13623
14080
|
functionName,
|
|
13624
|
-
args: functionName === "collectFees" || functionName === "getCumulatedFees0" || functionName === "getCumulatedFees1" ? [
|
|
14081
|
+
args: functionName === "collectFees" || functionName === "getCumulatedFees0" || functionName === "getCumulatedFees1" ? [poolId2] : [poolId2, beneficiary]
|
|
13625
14082
|
})
|
|
13626
14083
|
}));
|
|
13627
14084
|
}
|
|
@@ -14005,10 +14462,10 @@ async function getPendingFeeBreakdownForMulticurveTokens({
|
|
|
14005
14462
|
});
|
|
14006
14463
|
}
|
|
14007
14464
|
function createPendingFeeBreakdownPreviewPlan(poolContext, beneficiary) {
|
|
14008
|
-
const
|
|
14465
|
+
const poolId2 = computePoolId(poolContext.state.poolKey);
|
|
14009
14466
|
const poolCalls = createPendingFeePreviewCalls(
|
|
14010
14467
|
poolContext.initializerAddress,
|
|
14011
|
-
|
|
14468
|
+
poolId2,
|
|
14012
14469
|
beneficiary
|
|
14013
14470
|
);
|
|
14014
14471
|
if (poolContext.initializerKind !== "dopplerHook" || poolContext.dopplerHookAddress === viem.zeroAddress) {
|
|
@@ -14021,26 +14478,26 @@ function createPendingFeeBreakdownPreviewPlan(poolContext, beneficiary) {
|
|
|
14021
14478
|
return {
|
|
14022
14479
|
kind: "rehype",
|
|
14023
14480
|
poolContext,
|
|
14024
|
-
poolId,
|
|
14481
|
+
poolId: poolId2,
|
|
14025
14482
|
calls: [
|
|
14026
14483
|
...poolCalls,
|
|
14027
|
-
createRehypeCapabilityProbe(poolContext.dopplerHookAddress,
|
|
14484
|
+
createRehypeCapabilityProbe(poolContext.dopplerHookAddress, poolId2),
|
|
14028
14485
|
...createPendingFeePreviewCalls(
|
|
14029
14486
|
poolContext.dopplerHookAddress,
|
|
14030
|
-
|
|
14487
|
+
poolId2,
|
|
14031
14488
|
beneficiary
|
|
14032
14489
|
)
|
|
14033
14490
|
]
|
|
14034
14491
|
};
|
|
14035
14492
|
}
|
|
14036
|
-
function createRehypeCapabilityProbe(target,
|
|
14493
|
+
function createRehypeCapabilityProbe(target, poolId2) {
|
|
14037
14494
|
return {
|
|
14038
14495
|
target,
|
|
14039
14496
|
allowFailure: true,
|
|
14040
14497
|
callData: viem.encodeFunctionData({
|
|
14041
14498
|
abi: feesManagerAbi,
|
|
14042
14499
|
functionName: "getPoolKey",
|
|
14043
|
-
args: [
|
|
14500
|
+
args: [poolId2]
|
|
14044
14501
|
})
|
|
14045
14502
|
};
|
|
14046
14503
|
}
|
|
@@ -14202,7 +14659,7 @@ var RehypeDopplerHookInitializer = class {
|
|
|
14202
14659
|
* The fee amounts are newly collected pool fees, not necessarily the caller's
|
|
14203
14660
|
* beneficiary payout.
|
|
14204
14661
|
*/
|
|
14205
|
-
async claimFees(
|
|
14662
|
+
async claimFees(poolId2, options) {
|
|
14206
14663
|
const walletClient = this.requireWalletClient(
|
|
14207
14664
|
"Wallet client required to claim rehype beneficiary fees"
|
|
14208
14665
|
);
|
|
@@ -14210,23 +14667,25 @@ var RehypeDopplerHookInitializer = class {
|
|
|
14210
14667
|
address: this.hookAddress,
|
|
14211
14668
|
abi: rehypeFeesManagerAbi,
|
|
14212
14669
|
functionName: "collectFees",
|
|
14213
|
-
args: [
|
|
14670
|
+
args: [poolId2],
|
|
14214
14671
|
account: walletClient.account
|
|
14215
14672
|
});
|
|
14216
|
-
const hash = await walletClient.writeContract(
|
|
14673
|
+
const hash = await walletClient.writeContract(
|
|
14674
|
+
options?.gas === void 0 ? request : { ...request, gas: options.gas }
|
|
14675
|
+
);
|
|
14217
14676
|
await this.rpc.waitForTransactionReceipt({ hash, confirmations: 1 });
|
|
14218
14677
|
const [fees0, fees1] = result;
|
|
14219
14678
|
return { fees0, fees1, transactionHash: hash };
|
|
14220
14679
|
}
|
|
14221
|
-
async getPendingFees(
|
|
14680
|
+
async getPendingFees(poolId2, beneficiary) {
|
|
14222
14681
|
const calls = createPendingFeePreviewCalls(
|
|
14223
14682
|
this.hookAddress,
|
|
14224
|
-
|
|
14683
|
+
poolId2,
|
|
14225
14684
|
beneficiary
|
|
14226
14685
|
);
|
|
14227
14686
|
return calculatePendingFees(await callAggregate3(this.rpc, calls));
|
|
14228
14687
|
}
|
|
14229
|
-
async updateBeneficiary(
|
|
14688
|
+
async updateBeneficiary(poolId2, newBeneficiary) {
|
|
14230
14689
|
if (newBeneficiary.toLowerCase() === ZERO_ADDRESS) {
|
|
14231
14690
|
throw new Error(
|
|
14232
14691
|
"Rehype beneficiary cannot be updated to the zero address"
|
|
@@ -14239,7 +14698,7 @@ var RehypeDopplerHookInitializer = class {
|
|
|
14239
14698
|
address: this.hookAddress,
|
|
14240
14699
|
abi: feesManagerAbi,
|
|
14241
14700
|
functionName: "updateBeneficiary",
|
|
14242
|
-
args: [
|
|
14701
|
+
args: [poolId2, newBeneficiary],
|
|
14243
14702
|
account: walletClient.account
|
|
14244
14703
|
});
|
|
14245
14704
|
const hash = await walletClient.writeContract(request);
|
|
@@ -14262,48 +14721,82 @@ var RehypeDopplerHookInitializer = class {
|
|
|
14262
14721
|
const [fees0, fees1] = result;
|
|
14263
14722
|
return { fees0, fees1, transactionHash: hash };
|
|
14264
14723
|
}
|
|
14265
|
-
|
|
14724
|
+
/**
|
|
14725
|
+
* Replace a pool's complete fee distribution matrix.
|
|
14726
|
+
*
|
|
14727
|
+
* The connected wallet must be the pool's configured fee distribution
|
|
14728
|
+
* controller (`buybackDst`). The asset-fee allocations and numeraire-fee
|
|
14729
|
+
* allocations must each sum to WAD.
|
|
14730
|
+
*
|
|
14731
|
+
* @returns The confirmed transaction hash.
|
|
14732
|
+
*/
|
|
14733
|
+
async setFeeDistribution(poolId2, feeDistributionInfo) {
|
|
14734
|
+
const walletClient = this.requireWalletClient(
|
|
14735
|
+
"Wallet client required to set rehype fee distribution"
|
|
14736
|
+
);
|
|
14737
|
+
const { request } = await this.rpc.simulateContract({
|
|
14738
|
+
address: this.hookAddress,
|
|
14739
|
+
abi: rehypeDopplerHookInitializerAbi,
|
|
14740
|
+
functionName: "setFeeDistribution",
|
|
14741
|
+
args: [
|
|
14742
|
+
poolId2,
|
|
14743
|
+
feeDistributionInfo.assetFeesToAssetBuybackWad,
|
|
14744
|
+
feeDistributionInfo.assetFeesToNumeraireBuybackWad,
|
|
14745
|
+
feeDistributionInfo.assetFeesToBeneficiaryWad,
|
|
14746
|
+
feeDistributionInfo.assetFeesToLpWad,
|
|
14747
|
+
feeDistributionInfo.numeraireFeesToAssetBuybackWad,
|
|
14748
|
+
feeDistributionInfo.numeraireFeesToNumeraireBuybackWad,
|
|
14749
|
+
feeDistributionInfo.numeraireFeesToBeneficiaryWad,
|
|
14750
|
+
feeDistributionInfo.numeraireFeesToLpWad
|
|
14751
|
+
],
|
|
14752
|
+
account: walletClient.account
|
|
14753
|
+
});
|
|
14754
|
+
const hash = await walletClient.writeContract(request);
|
|
14755
|
+
await this.rpc.waitForTransactionReceipt({ hash, confirmations: 1 });
|
|
14756
|
+
return { transactionHash: hash };
|
|
14757
|
+
}
|
|
14758
|
+
async getFeeDistributionInfo(poolId2) {
|
|
14266
14759
|
const result = await this.rpc.readContract({
|
|
14267
14760
|
address: this.hookAddress,
|
|
14268
14761
|
abi: rehypeDopplerHookInitializerAbi,
|
|
14269
14762
|
functionName: "getFeeDistributionInfo",
|
|
14270
|
-
args: [
|
|
14763
|
+
args: [poolId2]
|
|
14271
14764
|
});
|
|
14272
14765
|
return normalizeRehypeFeeDistributionInfo(result);
|
|
14273
14766
|
}
|
|
14274
|
-
async getFeeRoutingMode(
|
|
14767
|
+
async getFeeRoutingMode(poolId2) {
|
|
14275
14768
|
const mode = await this.rpc.readContract({
|
|
14276
14769
|
address: this.hookAddress,
|
|
14277
14770
|
abi: rehypeDopplerHookInitializerAbi,
|
|
14278
14771
|
functionName: "getFeeRoutingMode",
|
|
14279
|
-
args: [
|
|
14772
|
+
args: [poolId2]
|
|
14280
14773
|
});
|
|
14281
14774
|
return Number(mode);
|
|
14282
14775
|
}
|
|
14283
|
-
async getFeeSchedule(
|
|
14776
|
+
async getFeeSchedule(poolId2) {
|
|
14284
14777
|
const result = await this.rpc.readContract({
|
|
14285
14778
|
address: this.hookAddress,
|
|
14286
14779
|
abi: rehypeDopplerHookInitializerAbi,
|
|
14287
14780
|
functionName: "getFeeSchedule",
|
|
14288
|
-
args: [
|
|
14781
|
+
args: [poolId2]
|
|
14289
14782
|
});
|
|
14290
14783
|
return normalizeRehypeFeeSchedule(result);
|
|
14291
14784
|
}
|
|
14292
|
-
async getHookFees(
|
|
14785
|
+
async getHookFees(poolId2) {
|
|
14293
14786
|
const result = await this.rpc.readContract({
|
|
14294
14787
|
address: this.hookAddress,
|
|
14295
14788
|
abi: rehypeDopplerHookInitializerAbi,
|
|
14296
14789
|
functionName: "getHookFees",
|
|
14297
|
-
args: [
|
|
14790
|
+
args: [poolId2]
|
|
14298
14791
|
});
|
|
14299
14792
|
return normalizeRehypeHookFees(result);
|
|
14300
14793
|
}
|
|
14301
|
-
async getPoolInfo(
|
|
14794
|
+
async getPoolInfo(poolId2) {
|
|
14302
14795
|
const result = await this.rpc.readContract({
|
|
14303
14796
|
address: this.hookAddress,
|
|
14304
14797
|
abi: rehypeDopplerHookInitializerAbi,
|
|
14305
14798
|
functionName: "getPoolInfo",
|
|
14306
|
-
args: [
|
|
14799
|
+
args: [poolId2]
|
|
14307
14800
|
});
|
|
14308
14801
|
return normalizeRehypePoolInfo(result);
|
|
14309
14802
|
}
|
|
@@ -14370,7 +14863,7 @@ var RehypeDopplerHookMigrator = class {
|
|
|
14370
14863
|
const [fees0, fees1] = result;
|
|
14371
14864
|
return { fees0, fees1, transactionHash: hash };
|
|
14372
14865
|
}
|
|
14373
|
-
async setFeeDistribution(
|
|
14866
|
+
async setFeeDistribution(poolId2, feeDistributionInfo) {
|
|
14374
14867
|
if (!this.walletClient) {
|
|
14375
14868
|
throw new Error("Wallet client required to set rehype fee distribution");
|
|
14376
14869
|
}
|
|
@@ -14379,7 +14872,7 @@ var RehypeDopplerHookMigrator = class {
|
|
|
14379
14872
|
abi: rehypeDopplerHookMigratorAbi,
|
|
14380
14873
|
functionName: "setFeeDistribution",
|
|
14381
14874
|
args: [
|
|
14382
|
-
|
|
14875
|
+
poolId2,
|
|
14383
14876
|
feeDistributionInfo.assetFeesToAssetBuybackWad,
|
|
14384
14877
|
feeDistributionInfo.assetFeesToNumeraireBuybackWad,
|
|
14385
14878
|
feeDistributionInfo.assetFeesToBeneficiaryWad,
|
|
@@ -14395,48 +14888,48 @@ var RehypeDopplerHookMigrator = class {
|
|
|
14395
14888
|
await this.rpc.waitForTransactionReceipt({ hash, confirmations: 1 });
|
|
14396
14889
|
return hash;
|
|
14397
14890
|
}
|
|
14398
|
-
async getFeeDistributionInfo(
|
|
14891
|
+
async getFeeDistributionInfo(poolId2) {
|
|
14399
14892
|
const result = await this.rpc.readContract({
|
|
14400
14893
|
address: this.hookAddress,
|
|
14401
14894
|
abi: rehypeDopplerHookMigratorAbi,
|
|
14402
14895
|
functionName: "getFeeDistributionInfo",
|
|
14403
|
-
args: [
|
|
14896
|
+
args: [poolId2]
|
|
14404
14897
|
});
|
|
14405
14898
|
return normalizeRehypeFeeDistributionInfo(result);
|
|
14406
14899
|
}
|
|
14407
|
-
async getFeeRoutingMode(
|
|
14900
|
+
async getFeeRoutingMode(poolId2) {
|
|
14408
14901
|
const mode = await this.rpc.readContract({
|
|
14409
14902
|
address: this.hookAddress,
|
|
14410
14903
|
abi: rehypeDopplerHookMigratorAbi,
|
|
14411
14904
|
functionName: "getFeeRoutingMode",
|
|
14412
|
-
args: [
|
|
14905
|
+
args: [poolId2]
|
|
14413
14906
|
});
|
|
14414
14907
|
return Number(mode);
|
|
14415
14908
|
}
|
|
14416
|
-
async getHookFees(
|
|
14909
|
+
async getHookFees(poolId2) {
|
|
14417
14910
|
const result = await this.rpc.readContract({
|
|
14418
14911
|
address: this.hookAddress,
|
|
14419
14912
|
abi: rehypeDopplerHookMigratorAbi,
|
|
14420
14913
|
functionName: "getHookFees",
|
|
14421
|
-
args: [
|
|
14914
|
+
args: [poolId2]
|
|
14422
14915
|
});
|
|
14423
14916
|
return normalizeRehypeHookFees(result);
|
|
14424
14917
|
}
|
|
14425
|
-
async getPoolInfo(
|
|
14918
|
+
async getPoolInfo(poolId2) {
|
|
14426
14919
|
const result = await this.rpc.readContract({
|
|
14427
14920
|
address: this.hookAddress,
|
|
14428
14921
|
abi: rehypeDopplerHookMigratorAbi,
|
|
14429
14922
|
functionName: "getPoolInfo",
|
|
14430
|
-
args: [
|
|
14923
|
+
args: [poolId2]
|
|
14431
14924
|
});
|
|
14432
14925
|
return normalizeRehypePoolInfo(result);
|
|
14433
14926
|
}
|
|
14434
|
-
async getPosition(
|
|
14927
|
+
async getPosition(poolId2) {
|
|
14435
14928
|
const result = await this.rpc.readContract({
|
|
14436
14929
|
address: this.hookAddress,
|
|
14437
14930
|
abi: rehypeDopplerHookMigratorAbi,
|
|
14438
14931
|
functionName: "getPosition",
|
|
14439
|
-
args: [
|
|
14932
|
+
args: [poolId2]
|
|
14440
14933
|
});
|
|
14441
14934
|
return normalizeRehypePosition(result);
|
|
14442
14935
|
}
|
|
@@ -18358,6 +18851,112 @@ var TopUpDistributor = class {
|
|
|
18358
18851
|
}
|
|
18359
18852
|
};
|
|
18360
18853
|
|
|
18854
|
+
// src/evm/entities/Bundler.ts
|
|
18855
|
+
var Bundler = class {
|
|
18856
|
+
publicClient;
|
|
18857
|
+
walletClient;
|
|
18858
|
+
bundlerAddress;
|
|
18859
|
+
constructor(publicClient, walletClient, bundlerAddress) {
|
|
18860
|
+
this.publicClient = publicClient;
|
|
18861
|
+
this.walletClient = walletClient;
|
|
18862
|
+
this.bundlerAddress = bundlerAddress;
|
|
18863
|
+
}
|
|
18864
|
+
get rpc() {
|
|
18865
|
+
return this.publicClient;
|
|
18866
|
+
}
|
|
18867
|
+
/** Returns the Bundler contract address used by this client. */
|
|
18868
|
+
getAddress() {
|
|
18869
|
+
return this.bundlerAddress;
|
|
18870
|
+
}
|
|
18871
|
+
/**
|
|
18872
|
+
* Reads the vesting position for an asset.
|
|
18873
|
+
*
|
|
18874
|
+
* @param asset Token whose Bundler position should be read.
|
|
18875
|
+
*/
|
|
18876
|
+
async getVesting(asset) {
|
|
18877
|
+
const result = await this.rpc.readContract({
|
|
18878
|
+
address: this.bundlerAddress,
|
|
18879
|
+
abi: bundlerAbi,
|
|
18880
|
+
functionName: "vestingOf",
|
|
18881
|
+
args: [asset]
|
|
18882
|
+
});
|
|
18883
|
+
const values = result;
|
|
18884
|
+
return {
|
|
18885
|
+
recipient: values[0],
|
|
18886
|
+
permissionlessClaim: values[1],
|
|
18887
|
+
start: values[2],
|
|
18888
|
+
cliffDuration: values[3],
|
|
18889
|
+
vestingDuration: values[4],
|
|
18890
|
+
totalAmount: values[5],
|
|
18891
|
+
claimedAmount: values[6]
|
|
18892
|
+
};
|
|
18893
|
+
}
|
|
18894
|
+
/**
|
|
18895
|
+
* Returns the amount currently claimable for an asset.
|
|
18896
|
+
*
|
|
18897
|
+
* @param asset Token whose claimable amount should be read.
|
|
18898
|
+
*/
|
|
18899
|
+
async getClaimable(asset) {
|
|
18900
|
+
return await this.rpc.readContract({
|
|
18901
|
+
address: this.bundlerAddress,
|
|
18902
|
+
abi: bundlerAbi,
|
|
18903
|
+
functionName: "claimable",
|
|
18904
|
+
args: [asset]
|
|
18905
|
+
});
|
|
18906
|
+
}
|
|
18907
|
+
/**
|
|
18908
|
+
* Simulates a claim and returns both the claimable amount and write request.
|
|
18909
|
+
*
|
|
18910
|
+
* The caller defaults to the configured wallet account. Pass `account` when
|
|
18911
|
+
* using a read-only SDK instance. For restricted positions, the caller must
|
|
18912
|
+
* be the recorded recipient.
|
|
18913
|
+
*
|
|
18914
|
+
* @param asset Token to claim.
|
|
18915
|
+
* @param account Account that will trigger the claim.
|
|
18916
|
+
*/
|
|
18917
|
+
async simulateClaim(asset, account) {
|
|
18918
|
+
const resolvedAccount = account ?? this.walletClient?.account;
|
|
18919
|
+
if (!resolvedAccount) {
|
|
18920
|
+
throw new Error(
|
|
18921
|
+
"An account is required to simulate a Bundler vesting claim"
|
|
18922
|
+
);
|
|
18923
|
+
}
|
|
18924
|
+
const { request, result } = await this.rpc.simulateContract({
|
|
18925
|
+
address: this.bundlerAddress,
|
|
18926
|
+
abi: bundlerAbi,
|
|
18927
|
+
functionName: "claim",
|
|
18928
|
+
args: [asset],
|
|
18929
|
+
account: resolvedAccount
|
|
18930
|
+
});
|
|
18931
|
+
return {
|
|
18932
|
+
amount: result,
|
|
18933
|
+
request
|
|
18934
|
+
};
|
|
18935
|
+
}
|
|
18936
|
+
/**
|
|
18937
|
+
* Claims the currently vested amount to the position's recorded recipient.
|
|
18938
|
+
*
|
|
18939
|
+
* Requires a configured wallet client. Permissionless callers may trigger a
|
|
18940
|
+
* claim but cannot redirect its proceeds.
|
|
18941
|
+
*
|
|
18942
|
+
* @param asset Token to claim.
|
|
18943
|
+
* @param options Optional transaction gas override.
|
|
18944
|
+
* @returns Submitted transaction hash.
|
|
18945
|
+
*/
|
|
18946
|
+
async claim(asset, options) {
|
|
18947
|
+
if (!this.walletClient) {
|
|
18948
|
+
throw new Error("Wallet client required for write operations");
|
|
18949
|
+
}
|
|
18950
|
+
const { request } = await this.simulateClaim(
|
|
18951
|
+
asset,
|
|
18952
|
+
this.walletClient.account
|
|
18953
|
+
);
|
|
18954
|
+
return await this.walletClient.writeContract(
|
|
18955
|
+
options?.gas === void 0 ? request : { ...request, gas: options.gas }
|
|
18956
|
+
);
|
|
18957
|
+
}
|
|
18958
|
+
};
|
|
18959
|
+
|
|
18361
18960
|
// src/evm/builders/StaticAuctionBuilder.ts
|
|
18362
18961
|
var StaticAuctionBuilder = class _StaticAuctionBuilder {
|
|
18363
18962
|
token;
|
|
@@ -19085,6 +19684,7 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19085
19684
|
schedule;
|
|
19086
19685
|
dopplerHook;
|
|
19087
19686
|
vesting;
|
|
19687
|
+
devBuy;
|
|
19088
19688
|
governance;
|
|
19089
19689
|
migration;
|
|
19090
19690
|
integrator;
|
|
@@ -19092,6 +19692,7 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19092
19692
|
salt;
|
|
19093
19693
|
moduleAddresses;
|
|
19094
19694
|
gasLimit;
|
|
19695
|
+
feeDistributionControllerAddress;
|
|
19095
19696
|
// Stored from withCurves() for graduationMarketCap conversion in build()
|
|
19096
19697
|
numerairePrice;
|
|
19097
19698
|
tokenDecimals;
|
|
@@ -19337,9 +19938,19 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19337
19938
|
"Cannot specify both graduationMarketCap and farTick. Use one or the other."
|
|
19338
19939
|
);
|
|
19339
19940
|
}
|
|
19340
|
-
|
|
19341
|
-
|
|
19342
|
-
|
|
19941
|
+
if (params.buybackDestination !== void 0 && this.feeDistributionControllerAddress !== void 0) {
|
|
19942
|
+
throw new Error(
|
|
19943
|
+
"Rehype buybackDestination and withFeeDistributionController are mutually exclusive"
|
|
19944
|
+
);
|
|
19945
|
+
}
|
|
19946
|
+
if (params.buybackDestination !== void 0 || this.feeDistributionControllerAddress !== void 0) {
|
|
19947
|
+
normalizeRehypeDopplerHookInitializerConfig(
|
|
19948
|
+
params,
|
|
19949
|
+
this.feeDistributionControllerAddress
|
|
19950
|
+
);
|
|
19951
|
+
}
|
|
19952
|
+
this.dopplerHook = params;
|
|
19953
|
+
this.initializer = { type: "rehype", config: params };
|
|
19343
19954
|
return this;
|
|
19344
19955
|
}
|
|
19345
19956
|
/** @deprecated Use withRehypeDopplerHookInitializer instead. */
|
|
@@ -19372,6 +19983,18 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19372
19983
|
};
|
|
19373
19984
|
return this;
|
|
19374
19985
|
}
|
|
19986
|
+
/**
|
|
19987
|
+
* Configures an exact-input purchase executed atomically with market creation.
|
|
19988
|
+
*
|
|
19989
|
+
* Omit `vesting` for direct delivery to `recipient`; when present, Bundler
|
|
19990
|
+
* holds the output and releases it under that schedule. This is independent
|
|
19991
|
+
* from `withVesting`, which configures token allocation vesting. Passing
|
|
19992
|
+
* `undefined` clears the dev buy.
|
|
19993
|
+
*/
|
|
19994
|
+
withDevBuy(params) {
|
|
19995
|
+
this.devBuy = params ? normalizeBuilderDevBuy(params) : void 0;
|
|
19996
|
+
return this;
|
|
19997
|
+
}
|
|
19375
19998
|
parseStartTimeSeconds(value, label) {
|
|
19376
19999
|
let startTimeSeconds;
|
|
19377
20000
|
if (value instanceof Date) {
|
|
@@ -19472,6 +20095,24 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19472
20095
|
this.governance = params;
|
|
19473
20096
|
return this;
|
|
19474
20097
|
}
|
|
20098
|
+
/**
|
|
20099
|
+
* Configure the address authorized to update a Rehype pool's fee
|
|
20100
|
+
* distribution matrix.
|
|
20101
|
+
*
|
|
20102
|
+
* This sets the on-chain `buybackDst`, which also receives direct-buyback
|
|
20103
|
+
* proceeds and legacy empty-beneficiary fees. Every Rehype initializer
|
|
20104
|
+
* requires either this method or `buybackDestination`; they configure the
|
|
20105
|
+
* same field and cannot be used together.
|
|
20106
|
+
*/
|
|
20107
|
+
withFeeDistributionController(address) {
|
|
20108
|
+
if (this.dopplerHook?.buybackDestination !== void 0) {
|
|
20109
|
+
throw new Error(
|
|
20110
|
+
"Rehype buybackDestination and withFeeDistributionController are mutually exclusive"
|
|
20111
|
+
);
|
|
20112
|
+
}
|
|
20113
|
+
this.feeDistributionControllerAddress = address;
|
|
20114
|
+
return this;
|
|
20115
|
+
}
|
|
19475
20116
|
withMigration(migration) {
|
|
19476
20117
|
this.migration = migration;
|
|
19477
20118
|
return this;
|
|
@@ -19505,6 +20146,9 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19505
20146
|
withAirlock(address) {
|
|
19506
20147
|
return this.overrideModule("airlock", address);
|
|
19507
20148
|
}
|
|
20149
|
+
withBundler(address) {
|
|
20150
|
+
return this.overrideModule("bundler", address);
|
|
20151
|
+
}
|
|
19508
20152
|
withV4MulticurveInitializer(address) {
|
|
19509
20153
|
this.assertCanSetInitializer("standard");
|
|
19510
20154
|
this.initializer = { type: "standard" };
|
|
@@ -19626,7 +20270,24 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19626
20270
|
);
|
|
19627
20271
|
}
|
|
19628
20272
|
}
|
|
20273
|
+
if (this.feeDistributionControllerAddress !== void 0 && this.dopplerHook === void 0) {
|
|
20274
|
+
throw new Error(
|
|
20275
|
+
"withFeeDistributionController requires a Rehype initializer configuration"
|
|
20276
|
+
);
|
|
20277
|
+
}
|
|
20278
|
+
const governance = this.governance ?? (isNoOpEnabledChain(this.chainId) ? { type: "noOp" } : { type: "default" });
|
|
20279
|
+
if (governance.type === "launchpad" && !isLaunchpadEnabledChain(this.chainId)) {
|
|
20280
|
+
throw new Error(
|
|
20281
|
+
`Launchpad governance is not supported on chain ${this.chainId}. Use a supported chain or a different governance type.`
|
|
20282
|
+
);
|
|
20283
|
+
}
|
|
19629
20284
|
let dopplerHook = this.dopplerHook;
|
|
20285
|
+
if (dopplerHook) {
|
|
20286
|
+
dopplerHook = normalizeRehypeDopplerHookInitializerConfig(
|
|
20287
|
+
dopplerHook,
|
|
20288
|
+
this.feeDistributionControllerAddress
|
|
20289
|
+
);
|
|
20290
|
+
}
|
|
19630
20291
|
if (dopplerHook?.graduationMarketCap !== void 0) {
|
|
19631
20292
|
const numerairePrice = dopplerHook.numerairePrice ?? this.numerairePrice;
|
|
19632
20293
|
if (!numerairePrice) {
|
|
@@ -19686,14 +20347,13 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19686
20347
|
);
|
|
19687
20348
|
}
|
|
19688
20349
|
}
|
|
19689
|
-
|
|
19690
|
-
dopplerHook = initializer.type === "rehype" ? initializer.config : void 0;
|
|
19691
|
-
const governance = this.governance ?? (isNoOpEnabledChain(this.chainId) ? { type: "noOp" } : { type: "default" });
|
|
19692
|
-
if (governance.type === "launchpad" && !isLaunchpadEnabledChain(this.chainId)) {
|
|
20350
|
+
if (this.devBuy && initializer.type !== "dopplerHookInitializer" && initializer.type !== "dopplerHook" && initializer.type !== "rehype") {
|
|
19693
20351
|
throw new Error(
|
|
19694
|
-
`
|
|
20352
|
+
`Dev buys require a DopplerHookInitializer or Rehype initializer; '${initializer.type}' is not supported`
|
|
19695
20353
|
);
|
|
19696
20354
|
}
|
|
20355
|
+
const schedule = initializer.type === "scheduled" ? { startTime: initializer.startTime } : void 0;
|
|
20356
|
+
dopplerHook = initializer.type === "rehype" ? initializer.config : void 0;
|
|
19697
20357
|
return {
|
|
19698
20358
|
token: this.token,
|
|
19699
20359
|
sale: this.sale,
|
|
@@ -19702,6 +20362,10 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
19702
20362
|
schedule,
|
|
19703
20363
|
dopplerHook,
|
|
19704
20364
|
vesting: this.vesting,
|
|
20365
|
+
devBuy: this.devBuy ? {
|
|
20366
|
+
...this.devBuy,
|
|
20367
|
+
vesting: { ...this.devBuy.vesting }
|
|
20368
|
+
} : void 0,
|
|
19705
20369
|
governance,
|
|
19706
20370
|
migration: this.migration,
|
|
19707
20371
|
integrator: this.integrator ?? ZERO_ADDRESS,
|
|
@@ -20090,6 +20754,7 @@ var DopplerSDK = class {
|
|
|
20090
20754
|
_factory;
|
|
20091
20755
|
_quoter;
|
|
20092
20756
|
_topUpDistributor;
|
|
20757
|
+
_bundler;
|
|
20093
20758
|
constructor(config) {
|
|
20094
20759
|
this.publicClient = config.publicClient;
|
|
20095
20760
|
this.walletClient = config.walletClient;
|
|
@@ -20142,6 +20807,34 @@ var DopplerSDK = class {
|
|
|
20142
20807
|
resolvedTopUpDistributor
|
|
20143
20808
|
);
|
|
20144
20809
|
}
|
|
20810
|
+
/**
|
|
20811
|
+
* Gets the Bundler client configured for this chain.
|
|
20812
|
+
*
|
|
20813
|
+
* Throws when the chain has no Bundler deployment. Use `getBundler(address)`
|
|
20814
|
+
* for custom deployments.
|
|
20815
|
+
*/
|
|
20816
|
+
get bundler() {
|
|
20817
|
+
if (!this._bundler) {
|
|
20818
|
+
this._bundler = this.getBundler();
|
|
20819
|
+
}
|
|
20820
|
+
return this._bundler;
|
|
20821
|
+
}
|
|
20822
|
+
/**
|
|
20823
|
+
* Creates a Bundler client using the chain default or an explicit address.
|
|
20824
|
+
*
|
|
20825
|
+
* Read methods work without a wallet client; claims require one.
|
|
20826
|
+
*
|
|
20827
|
+
* @param bundlerAddress Optional custom Bundler deployment.
|
|
20828
|
+
*/
|
|
20829
|
+
getBundler(bundlerAddress) {
|
|
20830
|
+
const resolvedBundler = bundlerAddress ?? getAddresses(this.chainId).bundler;
|
|
20831
|
+
if (!resolvedBundler || resolvedBundler === ZERO_ADDRESS) {
|
|
20832
|
+
throw new Error(
|
|
20833
|
+
"Bundler address is not configured on this chain. Pass bundlerAddress to getBundler()."
|
|
20834
|
+
);
|
|
20835
|
+
}
|
|
20836
|
+
return new Bundler(this.publicClient, this.walletClient, resolvedBundler);
|
|
20837
|
+
}
|
|
20145
20838
|
/**
|
|
20146
20839
|
* Get a StaticAuction instance for interacting with a static auction pool
|
|
20147
20840
|
* @param poolAddress The address of the Uniswap V3 pool
|
|
@@ -20363,6 +21056,7 @@ var VERSION = "1.0.0";
|
|
|
20363
21056
|
exports.ADDRESSES = ADDRESSES;
|
|
20364
21057
|
exports.AirlockCreateReceiptError = AirlockCreateReceiptError;
|
|
20365
21058
|
exports.BASIS_POINTS = BASIS_POINTS;
|
|
21059
|
+
exports.Bundler = Bundler;
|
|
20366
21060
|
exports.CHAIN_IDS = CHAIN_IDS;
|
|
20367
21061
|
exports.DAY_SECONDS = DAY_SECONDS;
|
|
20368
21062
|
exports.DEAD_ADDRESS = DEAD_ADDRESS;
|