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