@whetstone-research/doppler-sdk 1.0.30 → 1.0.31

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/dist/evm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import '../chunk-PZ5AY32C.js';
2
- import { parseEther, formatEther, getAddress, encodeAbiParameters, keccak256, decodeAbiParameters, encodePacked, decodeEventLog, toHex, zeroAddress, zeroHash, encodeFunctionData, isAddress, BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError, isHex, multicall3Abi, decodeFunctionResult, decodeErrorResult } from 'viem';
2
+ import { parseEther, formatEther, getAddress, encodeAbiParameters, keccak256, isAddress, zeroAddress, decodeAbiParameters, encodePacked, decodeEventLog, toHex, zeroHash, encodeFunctionData, multicall3Abi, decodeFunctionResult, BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError, isHex, decodeErrorResult } from 'viem';
3
3
 
4
4
  // src/evm/deployments.generated.ts
5
5
  var GENERATED_DOPPLER_DEPLOYMENTS = {
@@ -11,6 +11,7 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
11
11
  CloneERC20Factory: "0xe7Df2A4520C26a2D4Dedb3a7585BFBcd30eABA6e",
12
12
  CloneERC20Votes: "0xA8d0E8036D3fAE21C7Af075ad41942Bc1f807CDF",
13
13
  CloneERC20VotesFactory: "0x5A92bFfbc01ea0396A9c7D4154d36d4EAF2e483E",
14
+ DopplerCreateXDeployer: "0x103004E50Bed65DFBa30dD9c264B6BdF5e529B83",
14
15
  DopplerDeployer: "0xb35469ee64A87Afd19B31615094fE3962d73e421",
15
16
  DopplerERC20V1: "0xDB7B520bb5C3a2C5d4871198081911359f93be87",
16
17
  DopplerERC20V1Factory: "0x89C261C05B5F9b6BcBA07C199b8DeE7cFaD45292",
@@ -63,6 +64,7 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
63
64
  Bundler: "0xC99b485499f78995C6F1640dbB1413c57f8BA684",
64
65
  CloneDERC20VotesV2: "0x4BBfed1c27CDE12eF6638251D81ab4e3be7556b7",
65
66
  CloneDERC20VotesV2Factory: "0x16F5ACB64F4FA17296E942C51d3395aDC318f9e1",
67
+ DopplerCreateXDeployer: "0x103004E50Bed65DFBa30dD9c264B6BdF5e529B83",
66
68
  DopplerDeployer: "0xb35469ee64A87Afd19B31615094fE3962d73e421",
67
69
  DopplerERC20V1: "0xDB7B520bb5C3a2C5d4871198081911359f93be87",
68
70
  DopplerERC20V1Factory: "0x89C261C05B5F9b6BcBA07C199b8DeE7cFaD45292",
@@ -169,6 +171,7 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
169
171
  CloneDERC20VotesV2Factory: "0x16F5ACB64F4FA17296E942C51d3395aDC318f9e1",
170
172
  DecayMulticurveInitializer: "0xD59cE43E53D69F190E15d9822Fb4540dCcc91178",
171
173
  DecayMulticurveInitializerHook: "0xbB7784A4d481184283Ed89619A3e3ed143e1Adc0",
174
+ DopplerCreateXDeployer: "0x103004E50Bed65DFBa30dD9c264B6BdF5e529B83",
172
175
  DopplerDeployer: "0xb35469ee64A87Afd19B31615094fE3962d73e421",
173
176
  DopplerERC20V1: "0xDB7B520bb5C3a2C5d4871198081911359f93be87",
174
177
  DopplerERC20V1Factory: "0x89C261C05B5F9b6BcBA07C199b8DeE7cFaD45292",
@@ -266,10 +269,10 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
266
269
  MulticurveLibrary: "0x32238a39ba5aF060EFbfAda59979B639E0945fE0",
267
270
  NoOpGovernanceFactory: "0x7bD798fafC99A3b17E261F8308A8C11B56935ea1",
268
271
  NoOpMigrator: "0xF11066abbd329ac4bBA39455340539322C222eb0",
269
- Quoter: "0xFD44B773B21AC485C95Db1Ff38554b7699f8C042",
272
+ Quoter: "0x23C94d575C3e116fFDd7D5fbb50b7cA4972EdA83",
270
273
  RehypeDopplerHook: "0x3Ec4798A9B11e8243A8Db99687f7A23597B96623",
271
- RehypeDopplerHookInitializer: "0xBF4195ab0B03e1eB3345dd1e83BeD7650b1ed123",
272
- RehypeDopplerHookMigrator: "0xea95DfdF69B90c65C827070852F7039D6aF6Dd7b",
274
+ RehypeDopplerHookInitializer: "0x78C79C95eacEb2D08f7a55cc0D31012f8aF510c3",
275
+ RehypeDopplerHookMigrator: "0x9349E5A3e6458aa65E2fB7ED67e9aD08Ae7F660D",
273
276
  StreamableFeesLocker: "0x3345E557c5C0b474bE1eb4693264008B8562Aa9c",
274
277
  StreamableFeesLockerV2: "0xcE3212e6536F33cD6fbFEE265224131353Ca3D47",
275
278
  TeamGovernanceFactory: "0x8aF3001ED75F86f4Dd910577ECa9C5dB7CEa765c",
@@ -1235,7 +1238,7 @@ function estimateSlippage(amountIn, liquidity, currentTick, fee) {
1235
1238
  }
1236
1239
 
1237
1240
  // src/evm/abis/multicurve/feeClaimsAbi.ts
1238
- var feeClaimsInitializerAbi = [
1241
+ var feesManagerAbi = [
1239
1242
  {
1240
1243
  type: "function",
1241
1244
  name: "getCumulatedFees0",
@@ -1289,8 +1292,119 @@ var feeClaimsInitializerAbi = [
1289
1292
  { name: "fees1", type: "uint128", internalType: "uint128" }
1290
1293
  ],
1291
1294
  stateMutability: "nonpayable"
1292
- }
1295
+ },
1296
+ {
1297
+ type: "function",
1298
+ name: "getPoolKey",
1299
+ inputs: [{ name: "poolId", type: "bytes32", internalType: "PoolId" }],
1300
+ outputs: [
1301
+ {
1302
+ name: "currency0",
1303
+ type: "address",
1304
+ internalType: "Currency"
1305
+ },
1306
+ { name: "currency1", type: "address", internalType: "Currency" },
1307
+ { name: "fee", type: "uint24", internalType: "uint24" },
1308
+ { name: "tickSpacing", type: "int24", internalType: "int24" },
1309
+ { name: "hooks", type: "address", internalType: "contract IHooks" }
1310
+ ],
1311
+ stateMutability: "view"
1312
+ },
1313
+ {
1314
+ type: "function",
1315
+ name: "updateBeneficiary",
1316
+ inputs: [
1317
+ { name: "poolId", type: "bytes32", internalType: "PoolId" },
1318
+ { name: "newBeneficiary", type: "address", internalType: "address" }
1319
+ ],
1320
+ outputs: [],
1321
+ stateMutability: "nonpayable"
1322
+ },
1323
+ {
1324
+ type: "event",
1325
+ name: "Collect",
1326
+ inputs: [
1327
+ {
1328
+ name: "poolId",
1329
+ type: "bytes32",
1330
+ indexed: true,
1331
+ internalType: "PoolId"
1332
+ },
1333
+ {
1334
+ name: "fees0",
1335
+ type: "uint256",
1336
+ indexed: false,
1337
+ internalType: "uint256"
1338
+ },
1339
+ {
1340
+ name: "fees1",
1341
+ type: "uint256",
1342
+ indexed: false,
1343
+ internalType: "uint256"
1344
+ }
1345
+ ],
1346
+ anonymous: false
1347
+ },
1348
+ {
1349
+ type: "event",
1350
+ name: "Release",
1351
+ inputs: [
1352
+ {
1353
+ name: "poolId",
1354
+ type: "bytes32",
1355
+ indexed: true,
1356
+ internalType: "PoolId"
1357
+ },
1358
+ {
1359
+ name: "beneficiary",
1360
+ type: "address",
1361
+ indexed: true,
1362
+ internalType: "address"
1363
+ },
1364
+ {
1365
+ name: "fees0",
1366
+ type: "uint256",
1367
+ indexed: false,
1368
+ internalType: "uint256"
1369
+ },
1370
+ {
1371
+ name: "fees1",
1372
+ type: "uint256",
1373
+ indexed: false,
1374
+ internalType: "uint256"
1375
+ }
1376
+ ],
1377
+ anonymous: false
1378
+ },
1379
+ {
1380
+ type: "event",
1381
+ name: "UpdateBeneficiary",
1382
+ inputs: [
1383
+ {
1384
+ name: "poolId",
1385
+ type: "bytes32",
1386
+ indexed: false,
1387
+ internalType: "PoolId"
1388
+ },
1389
+ {
1390
+ name: "oldBeneficiary",
1391
+ type: "address",
1392
+ indexed: false,
1393
+ internalType: "address"
1394
+ },
1395
+ {
1396
+ name: "newBeneficiary",
1397
+ type: "address",
1398
+ indexed: false,
1399
+ internalType: "address"
1400
+ }
1401
+ ],
1402
+ anonymous: false
1403
+ },
1404
+ { type: "error", name: "CallerNotBeneficiary", inputs: [] },
1405
+ { type: "error", name: "InvalidNewBeneficiary", inputs: [] }
1293
1406
  ];
1407
+ var feeClaimsInitializerAbi = feesManagerAbi;
1294
1408
 
1295
1409
  // src/evm/abis/bytecodes/doppler.ts
1296
1410
  var doppler_default = "0x60a06040523461057b57604051601f615c0338819003918201601f19168301916001600160401b0383118484101761057f578084926101c09460405283398101031261057b5780516001600160a01b038116810361057b5760208201516040830151906060840151608085015160a08601519061007e60c088016105b3565b9161008b60e089016105b3565b91610100890151946100a06101208b016105b3565b976101408b0151978815988915810361057b576101608d01516101808e01516001600160a01b0381169e919d91908f0361057b576101a001519062ffffff821680920361057b576080525f6101a06100f6610593565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e0820152826101008201528261012082015282610140820152826101608201528261018082015201525f6101a0610154610593565b6001815260016020820152600160408201528260608201528260808201528260a0820152600160c0820152600160e082015260016101008201528261012082015282610140820152826101608201528261018082015201526120003016151560011480159061056a575b8015610559575b801561054c575b801561053f575b8015610532575b8015610522575b8015610512575b8015610502575b80156104f6575b80156104ea575b80156104de575b80156104d2575b80156104c6575b6104b35762ffffff1960165416176016558442116104a4578660020b8860020b91818303610463575b5050508484101561045457838503858111610440578a60020b5f811380159061042b575b61041c578915610408578982066103f9578c156103eb57600f8d116103eb578484116103dc5761029861029d928b81046017558b6105c1565b610658565b628000008110156103cf5762ffffff19601854169062ffffff1617601855600d55600e55600f5560105560115562ffffff6012549160181b65ffffff0000001692169065ffffffffffff1916171760125560135562ffffff63ff000000601454921560181b1692169063ffffffff1916171760145560155560018060a01b0319600c541617600c5560405161552f90816106d48239608051818181601c01528181610205015281816102a80152818161045c0152818161050c0152818161098701528181610a1e01528181610af501528181610b9201528181610c5a01528181610e8301528181610f3a0152818161103d015281816110b201528181611d2c01528181611de40152818161217801528181613b8301528181613c4d01528181613fe9015281816140f40152614be40152f35b6335278d125f526004601cfd5b638cc99b7b60e01b5f5260045ffd5b6287e39960e61b5f5260045ffd5b6388ac089760e01b5f5260045ffd5b634e487b7160e01b5f52601260045260245ffd5b6312469eb560e11b5f5260045ffd5b5061043a81610298848d6105c1565b1561025f565b634e487b7160e01b5f52601160045260245ffd5b63536a71af60e01b5f5260045ffd5b8061049b575b610483578a9182610491575b5050610483575f808061023b565b6264847d60e41b5f5260045ffd5b1390505f80610475565b50808212610469565b632ca4094f60e21b5f5260045ffd5b630732d7b560e51b5f523060045260245ffd5b50600130161515610212565b5060023016151561020b565b50600430161515610204565b506008301615156101fd565b506010301615156101f6565b50602030161515600114156101ef565b50604030161515600114156101e8565b50608030161515600114156101e1565b50610100301615156101da565b50610200301615156101d3565b50610400301615156101cc565b5061080030161515600114156101c5565b5061100030161515600114156101be565b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b604051906101c082016001600160401b0381118382101761057f57604052565b51908160020b820361057b57565b90670de0b6b3a76400008202905f19670de0b6b3a764000084099282808510940393808503948584111561057b571461065157670de0b6b3a764000082910981805f03168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b5091500490565b808202905f1983820990828083109203918083039283670de0b6b3a7640000111561057b57146106c2577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac1066993670de0b6b3a7640000910990828211900360ee1b910360121c170290565b5050670de0b6b3a76400009150049056fe608080604052600436101561005b575b50361561001a575f80fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361004c57005b6393c866c160e01b5f5260045ffd5b5f905f3560e01c908163182148ef146111155750806318cb1700146110f357806321d0ee701461109f578063259982e51461102a578063392e53cd1461100857806339518b5e14610feb578063514ea4bf14610f96578063575e24b414610ee357806357d775f814610ec65780636c2bbe7e14610e705780636c47a6c314610e535780636fe7e6eb14610c19578063897479cb14610bfb57806390ebab0a14610bdd57806391dd734614610b5e5780639ce110d714610b355780639f063efc14610ade578063a4dee15514610ab9578063b137392914610a98578063b356603014610a74578063b47b2fb1146109c6578063b6a8b0fa14610970578063c19d93fb14610921578063c4e833ce146107b6578063c70dfb4f14610795578063ce5494bb146104cb578063d0c52e21146104a9578063d65b4cb91461048b578063dc4c90d314610446578063dc98354e14610276578063dcf93f3214610250578063e1b4af69146101ee5763ee4644300361000f57346101eb57806003193601126101eb576020600d54604051908152f35b80fd5b50346101eb57600490610200366112dc565b5050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303925061024491505057630a85dc2960e01b8152fd5b63570c108560e11b8152fd5b50346101eb57806003193601126101eb57602060ff60145460181c166040519015158152f35b50346101eb5760e03660031901126101eb5761029061116b565b5060a03660231901126101eb576102a561128e565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036104375760085460ff81166104295760ff19166001176008556001600160a01b03602435908116908181036104255750600980546001600160a01b0319169190911790556044356001600160a01b038116908181036104255750600a80546001600160a01b03191691909117905560643562ffffff8116810361042157600a5461035a612061565b60b81b62ffffff60b81b169162ffffff60a01b9060a01b169065ffffffffffff60a01b19161717600a5560a43560018060a01b03811680910361042157600b80546001600160a01b031916919091179055601e6103b5612061565b60020b136104125760145460020b6103cb612061565b60020b9081156103fe570760020b6103ef57604051636e4c1aa760e11b8152602090f35b6312469eb560e11b8152600490fd5b634e487b7160e01b83526012600452602483fd5b63013840ad60e51b8152600490fd5b5080fd5b8280fd5b62dc149f60e41b8252600482fd5b63570c108560e11b8152600490fd5b50346101eb57806003193601126101eb576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346101eb57806003193601126101eb576020600f54604051908152f35b50346101eb57806003193601126101eb5760ff60209154166040519015158152f35b50346101eb5760203660031901126101eb576104e561116b565b600c546001600160a01b031633036107865760ff825460081c161580610765575b610756577f000000000000000000000000000000000000000000000000000000000000000061059d8361057561058360405161054181611333565b610549611f3d565b815260018060a01b03871660208201528360408201526001606082015260405192839160208301611f8a565b03601f1981018352826113b4565b604051809381926348c8949160e01b8352600483016112b2565b0381836001600160a01b0387165af190811561074b57916105d785926105e2959460e09791610729575b50602080825183010191016114d8565b600695919554613282565b9161064160018060a01b0360095416926106306105fe856145cf565b948761061f8761061760018060a01b03600a54166145cf565b9a8b94614611565b600a546001600160a01b0316614611565b60a061063a611f3d565b2090614754565b5050600954600a5492976001600160a01b039182169791909316946106879250610678906001600160801b03608086901d16611472565b926001600160801b0316611472565b906001600160801b0381111561071a57506001600160801b03915b506001600160801b0381111561070b57506001600160801b03935b604080516001600160a01b0397909716875260208701919091526001600160801b03608085811d821692880192909252918216606087015285019190915290811660a08401521660c0820152f35b6001600160801b0316936106bd565b6001600160801b0316916106a2565b61074591503d8086833e61073d81836113b4565b810190611fcb565b5f6105c7565b6040513d86823e3d90fd5b63051a2a5560e51b8252600482fd5b50600454600e5411158061077a575b15610506565b50601154421015610774565b638341a67960e01b8252600482fd5b50346101eb57806003193601126101eb57602060125460020b604051908152f35b50346101eb57806003193601126101eb576020816101c0926101a06040516107dd81611362565b82815282858201528260408201528260608201528260808201528260a08201528260c08201528260e0820152826101008201528261012082015282610140820152826101608201528261018082015201528060405161083b81611362565b60018152838101600181526040820160018152606083018481526080840185815260a0850186815260c08601906001825260e087019260018452610100880194600186526101208901968a88526101408a01988b8a526101a06101608c019b8d8d5261018081019d8e52019c8d526040519d8e916001835251151591015251151560408d015251151560608c015251151560808b015251151560a08a015251151560c089015251151560e08801525115156101008701525115156101208601525115156101408501525115156101608401525115156101808301525115156101a0820152f35b50346101eb57806003193601126101eb5760c064ffffffffff600154166002546003546004546005549160065493604051958652602086015260408501526060840152608083015260a0820152f35b50346101eb57600490610982366112dc565b5050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330392506102449150505763567d91d160e01b8152fd5b50346101eb576101603660031901126101eb576109e161116b565b5060a03660231901126101eb5760603660c31901126101eb57610144356001600160401b03811161042157610a1a903690600401611195565b50507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303610437576040610a5a610124356140d7565b82516001600160e01b03199092168252600f0b6020820152f35b50346101eb57806003193601126101eb57602060125460181c60020b604051908152f35b50346101eb57806003193601126101eb57602060145460020b604051908152f35b50346101eb57806003193601126101eb5760ff6020915460081c166040519015158152f35b50346101eb57600490610af036611225565b5050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330393506102449250505057630a85dc2960e01b8152fd5b50346101eb57806003193601126101eb57600c546040516001600160a01b039091168152602090f35b50346101eb5760203660031901126101eb576004356001600160401b03811161042157610b8f903690600401611195565b917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361043757610bd9610bcd848461168f565b604051918291826112b2565b0390f35b50346101eb57806003193601126101eb576020601554604051908152f35b50346101eb57806003193601126101eb576020600e54604051908152f35b5034610e4057610100366003190112610e4057610c3461116b565b60a0366023190112610e4057610c4861128e565b5060e435908160020b809203610e40577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169133839003610e445762ffffff6016541691833b15610e4057604051635275965160e01b815292602435906001600160a01b038216808303610e40576004860152604435946001600160a01b038616808703610e4057602482015260643562ffffff8116808203610e40576044830152608435918260020b808403610e4057606482015260a435936001600160a01b038516808603610e4057608483015260a48201525f8160c481838d5af18015610e3557610e07575b509488979461057594610da6948a9994610dc29960405196610d5a88611333565b60405194610d678661137e565b85526020850152604084015260608301526080820152835260018060a01b03166020830152604082015285606082015260405192839160208301611f8a565b6040519485809481936348c8949160e01b8352600483016112b2565b03925af18015610dfc57610de3575b604051636fe7e6eb60e01b8152602090f35b610df6913d8091833e61073d81836113b4565b5f610dd1565b6040513d84823e3d90fd5b610da69399509461057594610e245f610dc299949a959b986113b4565b5f9a94509450949791969095610d39565b6040513d5f823e3d90fd5b5f80fd5b63570c108560e11b5f5260045ffd5b34610e40575f366003190112610e40576020601154604051908152f35b34610e4057610e7e36611225565b5050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633039350610e449250505057630a85dc2960e01b5f5260045ffd5b34610e40575f366003190112610e40576020601354604051908152f35b34610e4057610140366003190112610e4057610efd61116b565b5060a0366023190112610e405760603660c3190112610e4057610124356001600160401b038111610e4057610f36903690600401611195565b50507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303610e4457606062ffffff610f766120bd565b906040939293519363ffffffff60e01b1684526020840152166040820152f35b34610e40576020366003190112610e40576004355f526007602052608060405f205460ff604051918060020b83528060181c60020b6020840152600180851b038160301c16604084015260b01c166060820152f35b34610e40575f366003190112610e40576020601054604051908152f35b34610e40575f366003190112610e4057602060ff600854166040519015158152f35b34610e4057611038366111c2565b5050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633039050610e4457306001600160a01b03909116036110905760405163259982e560e01b8152602090f35b636d1ed89b60e01b5f5260045ffd5b34610e40576110ad366111c2565b5050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633039150610e44905057630a85dc2960e01b5f5260045ffd5b34610e40575f366003190112610e4057602062ffffff60165416604051908152f35b34610e40575f366003190112610e4057600954600a54600b546001600160a01b039283168452818316602085015260a082811c62ffffff16604086015260b89290921c60020b6060850152909116608083015290f35b600435906001600160a01b0382168203610e4057565b35906001600160a01b0382168203610e4057565b9181601f84011215610e40578235916001600160401b038311610e405760208381860195010111610e4057565b90610160600319830112610e40576004356001600160a01b0381168103610e40579160a0602319820112610e4057602491608060c319830112610e405760c49161014435906001600160401b038211610e405761122191600401611195565b9091565b906101a0600319830112610e40576004356001600160a01b0381168103610e40579160a0602319820112610e4057602491608060c319830112610e405760c4916101443591610164359161018435906001600160401b038211610e405761122191600401611195565b60c435906001600160a01b0382168203610e4057565b35908160020b8203610e4057565b602060409281835280519182918282860152018484015e5f828201840152601f01601f1916010190565b610120600319820112610e40576004356001600160a01b0381168103610e40579160a0602319830112610e405760249160c4359160e4359161010435906001600160401b038211610e405761122191600401611195565b608081019081106001600160401b0382111761134e57604052565b634e487b7160e01b5f52604160045260245ffd5b6101c081019081106001600160401b0382111761134e57604052565b60a081019081106001600160401b0382111761134e57604052565b606081019081106001600160401b0382111761134e57604052565b601f909101601f19168101906001600160401b0382119082101761134e57604052565b359062ffffff82168203610e4057565b91908260a0910312610e40576040516113ff8161137e565b608061144b81839561141081611181565b855261141e60208201611181565b602086015261142f604082016113d7565b6040860152611440606082016112a4565b606086015201611181565b910152565b600201908160021161145e57565b634e487b7160e01b5f52601160045260245ffd5b9190820180921161145e57565b9060405161148c81611333565b9154600281810b8452601882901c900b6020840152603081901c6001600160801b0316604084015260b01c60ff166060830152565b600f0b60016001607f1b0319811461145e575f0390565b9190826040910312610e40576020825192015190565b80516001600160a01b03908116835260208083015182169084015260408083015162ffffff169084015260608083015160020b9084015260809182015116910152565b9061016092611542836060936114ee565b805160020b60a0840152602081015160020b60c0840152604081015160e084015201516101008201526101406101208201525f6101408201520190565b6001600160a01b03918216815291166020820152604081019190915260600190565b9190820391821161145e57565b6001600160401b03811161134e5760051b60200190565b906115cf826115ae565b6115dc60405191826113b4565b82815280926115ed601f19916115ae565b01905f5b8281106115fd57505050565b60209060405161160c81611333565b5f81525f838201525f60408201525f6060820152828285010152016115f1565b8051156116395760200190565b634e487b7160e01b5f52603260045260245ffd5b8051600110156116395760400190565b80518210156116395760209160051b010190565b9081549060181b65ffffff000000169065ffffff0000001916179055565b919082015f61010084830312610e40576116b5604051926116af84611333565b856113e7565b938483526116c560a08201611181565b80602085015260e06116d960c084016112a4565b92836040870152013580151594858203610e40576060015260018060a01b03169060020b92611c4e5750600164ffffffffff1981541617600155606084019261173c845160020b61173761172c85614ef6565b60125460020b61209f565b614f2e565b6014549060ff8260181c165f14611c3b5761175a9160020b9061209f565b945b61176584613378565b61176e85613378565b956040519561177c87611399565b808752602087018181526118d8604089019a888c526118d0600d54956117a06136a5565b956118088c6118036117fa6117db6117d26117c96117c46117bf61480d565b614ea2565b6136c3565b60135490614e80565b60105490614ebe565b6117f46117eb60105480936115a1565b916011546115a1565b90615033565b600d5490615113565b6136d4565b8c929083811315611c2c5761186b9293508981115f14611c275750885b928d60185460020b835160020b8082135f14611c1f5750905b50818a5260145460181c60ff1615611c105761185f9150895160020b61209f565b905b5160020b90614f2e565b60020b60208701525b855160020b966020870197885160020b14155f14611c055760ff60145460181c166118c5836118a68a5160020b613378565b8b516001600160801b039491906118bf9060020b613378565b91614fcc565b1660408801526115a1565b90848861374b565b996118eb6118e68c51611450565b6115c5565b985160020b915160020b9060018060801b03905116906040519261190e84611333565b8352602083015260408201526001606082015261192a8861162c565b526119348761162c565b50805160020b915160020b90604060018060801b0391015116906040519261195b84611333565b835260208301526040820152600260608201526119778661164d565b526119818561164d565b50835b8751811015611a3457611997818961165d565b515160020b60206119a8838b61165d565b51015160020b6001600160801b0360406119c2858d61165d565b51015116836003019182600311611a2057611a1992600195949260ff92604051946119ec86611333565b855260208501526040840152166060820152611a0783611450565b90611a12828b61165d565b528861165d565b5001611984565b634e487b7160e01b89526011600452602489fd5b50611a429293969585613a82565b611a4b8261162c565b516001855260076020526040852090805162ffffff198354169062ffffff16178255611a7e602082015160020b83611671565b60408101518254606090920151600160301b600160b81b031990921660309190911b600160301b600160b01b03161760b09190911b60ff60b01b16179055611ac58261164d565b516002855260076020526040852090805162ffffff198354169062ffffff16178255611af8602082015160020b83611671565b60408101518254606090920151600160301b600160b81b031990921660309190911b600160301b600160b01b03161760b09190911b60ff60b01b16179055835b8351811015611be557611b53611b4d82611450565b8461165d565b518160030180600311611bd1579060019291875260076020526040872090805162ffffff198354169062ffffff16178255611b95602082015160020b83611671565b604081015190825490606060ff60b01b91015160b01b16918560301b8660b01b039060301b16908560301b8660b81b0319161717905501611b38565b634e487b7160e01b87526011600452602487fd5b509291505060405190611bf96020836113b4565b81525f36602083013790565b8b60408801526115a1565b611c199161335b565b90611861565b90509061183e565b611825565b50508087526020870152611874565b611c489160020b9061335b565b9461175c565b925f9250829160015b6015546003018060031161145e57811015611ddc57805f526007602052611c8060405f2061147f565b60408101516001600160801b031680611c9e575b5050600101611c57565b611d279160409160ff6014999598995460181c1691825f14611dce57805160020b925b15611db95760ff6060611ce3611cde602085015160020b95613263565b6114c1565b9201511691845193611cf485611333565b60020b845260020b6020840152600f0b838301526060820152815180938192632d35e7ed60e11b83528c60048401611531565b03815f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1918215610e3557600192611d7e925f905f92611d86575b50611d789192613282565b96613282565b93905f611c94565b611d789250611dac915060403d8111611db2575b611da481836113b4565b8101906114d8565b91611d6d565b503d611d9a565b60ff6060611ce3611cde845160020b95613263565b602081015160020b92611cc1565b5091929390947f000000000000000000000000000000000000000000000000000000000000000091611e1860018060a01b0383511630856132c4565b926020830192611e3260018060a01b0385511630846132c4565b945f8113611ed6575b5050848413611e6a575b5050505050604051916020830152604082015260408152611e676060826113b4565b90565b91516001600160a01b039283169216823b15611ed25791611ea6939185809460405196879586948593630b0d9c0960e01b85526004850161157f565b03925af18015610dfc57611ebd575b808080611e45565b611ec88280926113b4565b6101eb5780611eb5565b8480fd5b90516001600160a01b0383811692911690823b15610e4057611f1392855f809460405196879586948593630b0d9c0960e01b85526004850161157f565b03925af18015610e3557611f28575b80611e3b565b611f359195505f906113b4565b5f935f611f22565b60405190611f4a8261137e565b6009546001600160a01b039081168352600a54808216602085015260a081901c62ffffff16604085015260b81c60020b6060840152600b54166080830152565b91909160e06060610100830194611fa28482516114ee565b60208101516001600160a01b031660a0850152604081015160020b60c085015201511515910152565b602081830312610e40578051906001600160401b038211610e40570181601f82011215610e40578051906001600160401b03821161134e576040519261201b601f8401601f1916602001856113b4565b82845260208383010111610e4057815f9260208093018386015e8301015290565b600f91820b910b019060016001607f1b0319821260016001607f1b0383131761145e57565b6084358060020b8103610e405790565b60020b627fffff19811461145e575f0390565b60020b60010190627fffff8213627fffff1983121761145e57565b9060020b9060020b0190627fffff198212627fffff83131761145e57565b5f80549160ff8360081c16613254576010544210613245576120dd61480d565b64ffffffffff600154161015613234575f9260115442101580613229575b612e7e575b509060ff5f5416155f14612e105761211661480d565b9060015461212b64ffffffffff8216846115a1565b64ffffffffff1990911664ffffffffff84161760015560035460025f526007602052946121645f8051602061550383398151915261147f565b9461219c60a06121753660246113e7565b207f0000000000000000000000000000000000000000000000000000000000000000614754565b505050946121a986614841565b608435978860020b90818a14159283610e40578a6121c691614f2e565b905f916121d68d600554906136d4565b5f198a0194908a861161145e575f8f966121f26121f791613a72565b614fac565b80971115911280612e09575b15612cac575050506122249192505160020b9161221e615332565b90614ebe565b955b60018111612c165750612262908a60055561225c670de0b6b3a764000061224f89600254614ebe565b9880612c0d575b05614ef6565b9061209f565b90612c09578761227191614f2e565b9061228d8861173761172c670de0b6b3a76400005f9905614ef6565b9760145460ff8160181c165f14612bf6576122ab9060020b8a61209f565b955b8960ff60145460181c16809b811580612be6575b15612baa57505050612ba6576122d7908361209f565b945b6122e283613378565b986122ec87613378565b908b15612b9d5715612aea5760016123058c8c84615420565b91818060a01b038c1690828060a01b0316038060ff1d9081011891818060801b031661233183826150ca565b928260601b9109151516015b975b60155461234e6118e682611450565b9060018a52600760205261236460408b2061147f565b61236d8361162c565b526123778261162c565b5060028a52600760205261238d60408b2061147f565b6123968361164d565b526123a08261164d565b50895b818110612aa25750506123c1906123bb3660246113e7565b90614afa565b5060145460181c60ff1699908a156129fc576044356001600160a01b03811681036129f857612402906123f3906145cf565b6001600160801b038316611472565b6006549061241a906001600160801b038316906115a1565b916024356001600160a01b03811681036129f4579e6118e69f936124728e969461245d8c9561244b89879a506145cf565b9060801d6001600160801b0316611472565b60809190911d6001600160801b0316906115a1565b9e5b61247f3660246113e7565b906124886136a5565b958361299457505050505060020b80825260208201528260408201525b604081018051909c6125ab916125a391612591916001600160801b031615612985575b6124d33660246113e7565b906124fa6124df6136a5565b976118036117fa6117db6117d26117c96117c46117bf61480d565b88808213156129715750818111156129685750612555815b928d606060185460020b920191825160020b8082135f146129605750905b60020b90818b5260ff60145460181c165f14611c105761185f91508a5160020b61209f565b60020b60208801525b865160020b976020880198895160020b14155f14612956575060ff60145460181c166118c5836118a68a5160020b613378565b878561259e3660246113e7565b61374b565b9e8f51611450565b9b6020825160020b92015160020b9060018060801b0390511690604051926125d284611333565b835260208301526040820152600160608201526125ee8c61162c565b526125f88b61162c565b50805160020b915160020b90604060018060801b0391015116906040519261261f84611333565b8352602083015260408201526002606082015261263b8a61164d565b526126458961164d565b50875b8b518110156126f9578b602061266d83612662818561165d565b515160020b9361165d565b51015160020b8d60406126878560018060801b039361165d565b510151168360030191826003116126e5579260ff6126de938f9360019796604051946126b286611333565b8552602085015260408401521660608201526126d76126d085611450565b809361165d565b528c61165d565b5001612648565b634e487b7160e01b8d52601160045260248dfd5b50612719919293949596999a979a6127123660246113e7565b918a613a82565b6127228761162c565b5160018a52600760205260408a2090805162ffffff198354169062ffffff16178255612755602082015160020b83611671565b60408101518254606090920151600160301b600160b81b031990921660309190911b600160301b600160b01b03161760b09190911b60ff60b01b1617905561279c8761164d565b5160028a52600760205260408a2090805162ffffff198354169062ffffff161782556127cf602082015160020b83611671565b60408101518254606090920151600160301b600160b81b031990921660309190911b600160301b600160b01b03161760b09190911b60ff60b01b16179055885b6015548110156128fc578651811061285957806003018060031161284557906001918b5260076020528a60408120555b0161280f565b634e487b7160e01b8b52601160045260248bfd5b61286b61286582611450565b8961165d565b5181600301806003116128e85790600192918c52600760205260408c2090805162ffffff198354169062ffffff161782556128ad602082015160020b83611671565b604081015190825490606060ff60b01b91015160b01b16918560301b8660b01b039060301b16908560301b8660b81b0319161717905561283f565b634e487b7160e01b8c52601160045260248cfd5b5090919295507f223157ec47d7bd04fa3ed10c0a8adb38faf97b51ec856a777425a2e39253bd739450608093966040519360020b845260020b602084015260020b60408301526060820152a15b6315d7892d60e21b929190565b60408801526115a1565b905090612530565b61255590612512565b9250508b60020b808852602088015261255e565b602085015160020b85526124c8565b838111156129ad5750506129a89450614ca4565b6124a5565b92509350506129e991508c60020b84528960020b60208501526129cf8d613378565b6001600160801b0393906129e28c613378565b9115614fcc565b1660408201526124a5565b8c80fd5b8a80fd5b6024356001600160a01b03811681036129f857612a2f90612a1c906145cf565b608083901d6001600160801b0316611472565b60065490612a4b90608083901d6001600160801b0316906115a1565b916044356001600160a01b03811681036129f4579e6118e69f93612a9c8e9694612a8b8c95612a7c89879a506145cf565b906001600160801b0316611472565b6001600160801b03909116906115a1565b9e612474565b80600301806003116128e857906001918c526007602052612ae360408d20612ad2612acc84611450565b9161147f565b612adc828861165d565b528561165d565b50016123a3565b612af58b8b836153dd565b8a826001600160a01b0380831690821611612b92575b506001600160a01b038316918215612b865760601b600160601b600160e01b0316926001600160a01b03828116929190910316612b4982828661527d565b938215612b725709612b63575b808206151591040161233d565b906001019081612b56575b8880fd5b634e487b7160e01b8c52601260045260248cfd5b62bfc9218b526004601cfd5b8c935090505f612b0b565b5050869761233f565b8680fd5b91989392509081612bd5575b50612bc2575b506122d9565b612bce9196508361335b565b945f612bbc565b905060020b8460020b13155f612bb6565b508060020b8760020b12156122c1565b612c039060020b8a61335b565b956122ad565b8580fd5b89600255612256565b612c1f906136ec565b5f198101818111611a20576121f2612c3691613a72565b808c10612c44575b50612226565b612c59612c52989298615332565b918d615033565b670de0b6b3a76400000390670de0b6b3a76400008211612c9857612c8a612c919392670de0b6b3a764000092614e80565b0590614ebe565b955f612c3e565b634e487b7160e01b8a52601160045260248afd5b9192909115612d0957505083612b6e578a612cc691614f2e565b91612cd2612c52615332565b670de0b6b3a76400000390670de0b6b3a76400008211612c9857612c8a612d039392670de0b6b3a764000092614e80565b95612226565b93509350975050612d2f60125460020b670de0b6b3a76400006002540560020b9061209f565b60185460020b5f9381135f14612dfe57905b6014549260ff8460181c1692835f14612deb57612d61915160020b61209f565b915b829985610e4057612db394612d7b8e612dab96614f2e565b938315612dd857612d8f9160020b9061209f565b915b15612dc3578160020b8160020b135f14612dbc575061335b565b60020b614e5c565b955f9695612226565b905061335b565b8160020b8160020b125f14612dbc575061335b565b612de59160020b9061335b565b91612d91565b612df8915160020b61335b565b91612d63565b505f92508990612d41565b5080612203565b915060ff60145460181c168080612e67575b8115612e47575b50612e38576240000090612949565b63016ccb0760e01b5f5260045ffd5b90501580612e56575b5f612e29565b5060c4358015158114612e50575f80fd5b905060c43580159081158103610e40575090612e22565b600454600e54111561321a5760019060ff1916175f557fe8775e4a58023f399765c3455b45eebcc45ad6b99607a1163f02e1318430970c5f80a1612ed3612ecb60a06121753660246113e7565b505050614841565b601554612ee26118e682611450565b60015f52600760205290612f025f805160206154e383398151915261147f565b612f0b8361162c565b52612f158261162c565b5060025f526007602052612f355f8051602061550383398151915261147f565b612f3e8361164d565b52612f488261164d565b505f5b8181106131e9575050612f63906123bb3660246113e7565b5060145460181c60ff1690811561319e576044356001600160a01b0381168103610e4057612fce918491612fb8906001600160801b0390612fa3906145cf565b16600f0b60018060801b0392600f0b9061203c565b165b60035490612fc93660246113e7565b614ca4565b90604080519290612fdf81856113b4565b60018452601f19015f5b81811061316f575050805160020b6020820191825160020b90604060018060801b0391015116906040519261301d84611333565b835260208301526040820152600160608201526130398461162c565b526130438361162c565b505160020b901561314657608435928360020b8403610e405761308061307a613075613093948761309898509061209f565b613378565b91613378565b9061308c3660246113e7565b9184613a82565b61162c565b5160015f52600760205260405f2090805162ffffff198354169062ffffff161782556130cb602082015160020b83611671565b60408101518254606090920151600160301b600160b81b031990921660309190911b600160301b600160b01b03161760b09190911b60ff60b01b161790555f5b6015546001810180911161145e5781101561313f578061312c600192611450565b5f5260076020525f60408120550161310b565b505f612100565b608435928360020b8403610e405761308061307a6130756130939461225c886130989950612071565b60209060405161317e81611333565b5f81525f838201525f60408201525f606082015282828801015201612fe9565b6024356001600160a01b0381168103610e4057612fce9184916131e3906001600160801b03906131cd906145cf565b6001600160801b039360801d9116600f0b61203c565b16612fba565b80600301908160031161145e576001915f52600760205261321360405f20612ad2612acc84611450565b5001612f4b565b631ed9bcf960e01b5f5260045ffd5b5060ff8116156120fb565b6315d7892d60e21b92505f91508190565b630fc95b4360e01b5f5260045ffd5b636fce6c3960e01b5f5260045ffd5b6001607f1b81101561327557600f0b90565b6335278d125f526004601cfd5b6132a5906132978360801d8260801d01614ed9565b92600f0b90600f0b01614ed9565b60018060801b03169060801b1790565b90816020910312610e40575190565b6001600160a01b039182165f9081529282166020908152604093849020935163789add5560e11b815260048101949094529183916024918391165afa908115610e35575f91613311575090565b90506020813d602011613338575b8161332c602093836113b4565b81010312610e40575190565b3d915061331f565b60020b5f190190627fffff198212627fffff83131761145e57565b600291820b910b0390627fffff198212627fffff83131761145e57565b60020b908160ff1d82810118620d89e881116136925763ffffffff9192600182167001fffcb933bd6fad37aa2d162d1a59400102600160801b189160028116613676575b6004811661365a575b6008811661363e575b60108116613622575b60208116613606575b604081166135ea575b608081166135ce575b61010081166135b2575b6102008116613596575b610400811661357a575b610800811661355e575b6110008116613542575b6120008116613526575b614000811661350a575b61800081166134ee575b6201000081166134d2575b6202000081166134b7575b62040000811661349c575b6208000016613483575b5f1261347b575b0160201c90565b5f1904613474565b6b048a170391f7dc42444e8fa290910260801c9061346d565b6d2216e584f5fa1ea926041bedfe9890920260801c91613463565b916e5d6af8dedb81196699c329225ee6040260801c91613458565b916f09aa508b5b7a84e1c677de54f3e99bc90260801c9161344d565b916f31be135f97d08fd981231505542fcfa60260801c91613442565b916f70d869a156d2a1b890bb3df62baf32f70260801c91613438565b916fa9f746462d870fdf8a65dc1f90e061e50260801c9161342e565b916fd097f3bdfd2022b8845ad8f792aa58250260801c91613424565b916fe7159475a2c29b7443b29c7fa6e889d90260801c9161341a565b916ff3392b0822b70005940c7a398e4b70f30260801c91613410565b916ff987a7253ac413176f2b074cf7815e540260801c91613406565b916ffcbe86c7900a88aedcffc83b479aa3a40260801c916133fc565b916ffe5dee046a99a2a811c461f1969c30530260801c916133f2565b916fff2ea16466c96a3843ec78b326b528610260801c916133e9565b916fff973b41fa98c081472e6896dfb254c00260801c916133e0565b916fffcb9843d60f6159c9db58835c9266440260801c916133d7565b916fffe5caca7e10e4e61c3624eaa0941cd00260801c916133ce565b916ffff2e50f5f656932ef12357cf3c7fdcc0260801c916133c5565b916ffff97272373d413259a46990580e213a0260801c916133bc565b826345c3193d60e11b5f5260045260245ffd5b604051906136b282611399565b5f6040838281528260208201520152565b905f19820191821360011661145e57565b81810392915f13801582851316918412161761145e57565b801561145e575f190190565b60020b9060020b90811561371a57627fffff1981145f1983141661145e570590565b634e487b7160e01b5f52601260045260245ffd5b8181029291811591840414171561145e57565b811561371a570490565b9291909161375761480d565b613764601354809261372e565b906137726010548093611472565b9060115492838311613a46575b61378761480d565b6001810180911161145e576137a49261379f9161372e565b611472565b91808311613a3e575b50808214613a01576137e06137cf6137e6936117f46117eb60105480936115a1565b916117f46117eb60105480936115a1565b906115a1565b936015549384805b6139c0575b5061380a6020613814920194855160020b9061335b565b8560020b906136f8565b918461384b60ff60145460181c1694855f1461398657606085015160020b90818160020b125f1461397f57505b97600d5490615113565b9180613857838561372e565b1161396f575050925b5160020b9461386e856115ae565b9561387c60405197886113b4565b858752601f1961388b876115ae565b015f5b8181106139585750505f905b8682106138ab575050505050505090565b6138b5828961165d565b519060020b905260016138e76138d9846138cf858c61165d565b515160020b61209f565b606086015160020b90614f2e565b9160206138f4828b61165d565b51018360020b9052613939878a613932602061392786613921613917828761165d565b515160020b613378565b9461165d565b51015160020b613378565b9089614fcc565b6040613945838c61165d565b510190838060801b03169052019061389a565b6020906139636136a5565b82828c0101520161388e565b6139799250613741565b92613860565b9050613841565b60608501613997815160020b612071565b60020b8260020b125f146139ad57505b976117fa565b6139bb91505160020b612071565b6139a7565b945f19860186811161145e576139d590615001565b6139de87615001565b036139fb576139ef6139f5916136ec565b956136ec565b806137ee565b946137f3565b505050505050604051613a156020826113b4565b5f81525f805b818110613a2757505090565b602090613a326136a5565b82828601015201613a1b565b91505f6137ad565b83925061377f565b805115158252602080820151908301526040908101516001600160a01b0316910152565b600160ff1b811461145e575f0390565b9392916001600160a01b039182169116818103613f83575b50505f915f5b8451811015613c0d576001600160801b036040613abd838861165d565b51015116613ace575b600101613aa0565b613b7e90604060ff60145460181c16805f14613bf557613aee838961165d565b515160020b905b15613be1576020613b06848a61165d565b51015160020b5b613b2c6001600160801b0384613b23878d61165d565b51015116613263565b60ff6060613b3a878d61165d565b5101511691845193613b4b85611333565b60020b845260020b6020840152600f0b838301526060820152815180948192632d35e7ed60e11b83528860048401611531565b03815f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1918215610e3557600192613bc4575b509050613ac6565b613bdb9060403d8111611db257611da481836113b4565b50613bbc565b613beb838961165d565b515160020b613b0d565b6020613c01848a61165d565b51015160020b90613af5565b509190928051905f19820191821161145e57602091613c2b9161165d565b5101516018549060181b65ffffff000000169065ffffff0000001916176018557f0000000000000000000000000000000000000000000000000000000000000000613c8060018060a01b0385511630836132c4565b906020850194613c9a60018060a01b0387511630846132c4565b925f8113613f1c575b848413613ea7575b848112613db4575b5050828212613cc4575b5050509050565b84516001600160a01b039081169591169190823b15613db05760405195632961046560e21b87526004870152838660248183875af195861561074b57849596613d93575b505160209291613d2d916001600160a01b0316908390613d2790613a72565b91614611565b600460405180958193630476982d60e21b83525af1908115613d875750613d58575b80808392613cbd565b613d799060203d602011613d80575b613d7181836113b4565b8101906132b5565b505f613d4f565b503d613d67565b604051903d90823e3d90fd5b84613da29195929394956113b4565b613db057908392915f613d08565b8380fd5b81516001600160a01b03848116939116833b15612ba65760405190632961046560e21b82526004820152868160248183885af18015613e9c57908791613e87575b505080516001600160a01b031680613e73575b50516001600160a01b0316613e6957613e22602091613a72565b915b600460405180948193630476982d60e21b83525af1801561074b57613e4a575b80613cb3565b613e629060203d602011613d8057613d7181836113b4565b505f613e44565b5060208491613e24565b613e819084613d2785613a72565b5f613e08565b81613e91916113b4565b612c0957855f613df5565b6040513d89823e3d90fd5b86516001600160a01b038481169116813b15612ba65785613ee392889283604051809681958294630b0d9c0960e01b845230906004850161157f565b03925af18015613f1157908691613efc575b5050613cab565b81613f06916113b4565b611ed257845f613ef5565b6040513d88823e3d90fd5b81516001600160a01b03908116908416803b15610e4057825f91613f599383604051809681958294630b0d9c0960e01b845230906004850161157f565b03925af18015610e3557613f6e575b50613ca3565b613f7b9195505f906113b4565b5f935f613f68565b60405191613f9083611399565b81108252600160208301526040820152613fc860405191633cf3645360e21b8352613fbe60048401856114ee565b60a4830190613a4e565b6101206101048201525f610124820152602081610144815f60018060a01b037f0000000000000000000000000000000000000000000000000000000000000000165af18015610e355761401c575b80613a9a565b6140349060203d602011613d8057613d7181836113b4565b505f614016565b6101409290916140c391906001600160a01b0361405782611181565b1684526001600160a01b0361406e60208301611181565b16602085015262ffffff614084604083016113d7565b166040850152614096606082016112a4565b60020b60608501526001600160a01b03906140b390608001611181565b16608084015260a0830190613a4e565b6101206101008201525f6101208201520190565b60ff5f54166145c1576141299060a06140f13660246113e7565b207f00000000000000000000000000000000000000000000000000000000000000009061411e8183614754565b949290969150614841565b60145460181c60ff1680156145ae5760185460181c60020b8260020b135b60015f5260076020525f805160206154e38339815191525460020b9082156145a257818460020b12905b156144c05750505050906141ea91602060ff60145460181c16805f146144ac576141a561307560185460181c60020b612084565b604051916141b283611399565b151582526001838301526001600160a01b031660408083019190915251633cf3645360e21b815294859182919060246004840161403b565b03815f6001600160a01b0386165af18015610e3557614479575b61420e9250614754565b50509050925b60c435908115158203610e405762ffffff91610fff9182911561447057165b169116620f42408183020491010360ff60145460181c165f146143c757608082901d5f600f82900b1261438257600354614276916001600160801b031690611472565b6003555b600f82900b5f81126143285750505f805160206154c3833981519152916142ad60609260018060801b03166004546115a1565b6004555b600454600f548110156142e4575b600354906040519260020b835260208301526040820152a163b47b2fb160e01b905f90565b61010061ff00195f5416175f557f628a470bfdde264ef77cd19acfbfca22b3e4413adaf5837ec9fbc0043e35793f602061431c61480d565b604051908152a16142bf565b62ffffff919250614338906114c1565b9116620f42400391620f4240831161145e575f805160206154c38339815191529260609261437a91614372916001600160801b031661518e565b600454611472565b6004556142b1565b61438b906114c1565b62ffffff8216620f42400390620f4240821161145e576143bf916143b7916001600160801b031661518e565b6003546115a1565b60035561427a565b90600f81900b5f811261443357506003546143ec906001600160801b03831690611472565b6003555b60801d905f600f83900b1261442557505f805160206154c38339815191529161437a60609260018060801b03166004546115a1565b9061433862ffffff916114c1565b61443c906114c1565b62ffffff8316620f42400390620f4240821161145e57614468916143b7916001600160801b031661518e565b6003556143f0565b600c1c16614233565b6020833d6020116144a4575b81614492602093836113b4565b81010312610e405761420e9250614204565b3d9150614485565b6141a561307560185460181c60020b613340565b97949392976144d3575b50505050614214565b614534949750906144f0602092825f146145995761307590613340565b604051916144fd83611399565b1582526001838301526001600160a01b031660408083019190915251633cf3645360e21b815294859182919060246004840161403b565b03815f6001600160a01b0386165af18015610e3557614566575b6145589250614754565b50509050925f8080806144ca565b6020833d602011614591575b8161457f602093836113b4565b81010312610e4057614558925061454e565b3d9150614572565b61307590612084565b818460020b1390614171565b60185460181c60020b8260020b12614147565b5063b47b2fb160e01b905f90565b6001600160a01b0316806145e257504790565b6020602491604051928380926370a0823160e01b82523060048301525afa908115610e35575f91613311575090565b9091906001600160a01b038116908161469f5750505f80808093855af1156146365750565b6040516390bfb86560e01b81526001600160a01b0390911660048201525f602482018190526080604483015260a03d601f01601f191690810160648401523d6084840152903d9060a484013e808201600460a482015260c4633d2cec6f60e21b91015260e40190fd5b60205f604481949682604095865198899363a9059cbb60e01b855260018060a01b0316600485015260248401525af13d15601f3d116001855114161716928281528260208201520152156146f05750565b6040516390bfb86560e01b8152600481019190915263a9059cbb60e01b602482015260806044820152601f3d01601f191660a0810160648301523d60848301523d5f60a484013e808201600460a482015260c4633c9fd93960e21b91015260e40190fd5b919060209060405182810191825260066040820152604081526147786060826113b4565b519020604051631e2eaeaf60e01b8152600481019190915292839060249082906001600160a01b03165afa918215610e35575f926147d9575b506001600160a01b0382169160a081901c60020b9162ffffff60b883901c81169260d01c1690565b9091506020813d602011614805575b816147f5602093836113b4565b81010312610e405751905f6147b1565b3d91506147e8565b60105480421061483b5761482461482d91426115a1565b60135490613741565b6001810180911161145e5790565b50600190565b73fffd8963efd1fc6a506488495d951d51639616826401000276a21982016001600160a01b031611614ada57602081901b600160201b600160c01b0316808015610e4057693627a301d71055774c859160ff8260018060801b031060071b83811c60018060401b031060061b1783811c63ffffffff1060051b1783811c61ffff1060041b1783811c821060031b177b01c1818141808140018080c0814100004181408140c0c100414140c160221b6f8421084210842108cc6318c6db6d54be85831c1c601f161a17169160808310155f14614ace5750607e1982011c5b800280607f1c8160ff1c1c800280607f1c8160ff1c1c800280607f1c8160ff1c1c800280607f1c8160ff1c1c800280607f1c8160ff1c1c800280607f1c8160ff1c1c80029081607f1c8260ff1c1c80029283607f1c8460ff1c1c80029485607f1c8660ff1c1c80029687607f1c8860ff1c1c80029889607f1c8a60ff1c1c80029a8b607f1c8c60ff1c1c80029c8d80607f1c9060ff1c1c600160321b90800260cd1c169d600160331b9060cc1c169c600160341b9060cb1c169b600160351b9060ca1c169a600160361b9060c91c1699600160371b9060c81c1698600160381b9060c71c1697600160391b9060c61c16966001603a1b9060c51c16956001603b1b9060c41c16946001603c1b9060c31c16936001603d1b9060c21c16926001603e1b9060c11c16916001603f1b9060c01c1690607f190160401b1717171717171717171717171717026fdb2df09e81959a81455e260799a0632f6f028f6481ab7f045a5af012a19d003aa919820160801d60020b910160801d60020b918282145f14614aaa5750905090565b6001600160a01b0390811690614abf84613378565b1611614ac9575090565b905090565b905081607f031b61491e565b6318521d4960e21b5f9081526001600160a01b0391909116600452602490fd5b91905f905f905f5b8551811015614c8d576001600160801b036040614b1f838961165d565b51015116614b30575b600101614b02565b9192614bdf604060ff60145460181c16805f14614c7557614b51868a61165d565b515160020b905b15614c61576020614b69878b61165d565b51015160020b5b8960ff6060614b9b8a6139216001600160801b0389614b8f848961165d565b51015116600f0b6114c1565b5101511691845193614bac85611333565b60020b845260020b6020840152600f0b838301526060820152815180938192632d35e7ed60e11b83528760048401611531565b03815f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1918215610e3557600192614c36925f905f92614c3e575b50614c309192613282565b95613282565b929050614b28565b614c309250614c5b915060403d8111611db257611da481836113b4565b91614c25565b614c6b868a61165d565b515160020b614b70565b6020614c81878b61165d565b51015160020b90614b58565b505091909250614c9f82600654613282565b600655565b9093929193614cb16136a5565b9480614e0457505f5b6001600160a01b031680614cde5750505060020b80835260208301525f6040830152565b919250614de991614d9090606090614d829060b56001600160881b03821160071b82811c6001600160481b031060061b1782811c64ffffffffff1060051b1782811c62ffffff1060041b17600181811c9290921b9083901c62010000010260121c80830401811c80830401811c80830401811c80830401811c80830401811c80830401811c80830401901c908190048111900360301b6001600160a01b0316614841565b940193845160020b90614f2e565b92614dd1602087019460020b9182865260ff60145460181c1692835f14614df15750614dc690865160020b905160020b9061335b565b60020b808852613378565b93516001600160801b0394906129e29060020b613378565b166040830152565b614dff915160020b9061209f565b614dc6565b8160ff60145460181c165f14614e3d5750600654614e3891614e329160801d6001600160801b0316906115a1565b826152fd565b614cba565b600654614e3892614e57916001600160801b0316906115a1565b6152fd565b90670de0b6b3a7640000820291808305670de0b6b3a7640000149015171561145e57565b81810292915f8212600160ff1b82141661145e57818405149015171561145e57565b9060018201915f60018412911290801582169115161761145e57565b9190915f838201938412911290801582169115161761145e57565b9081600f0b918203614ee757565b6393dafdf160e01b5f5260045ffd5b80628000000160181c15614f11576335278d125f526004601cfd5b60020b90565b9060020b9060020b02908160020b91820361145e57565b9060ff60145460181c165f14614f7a575f8260020b125f14614f6d57614f6881614f63614f5e82611e679661335b565b612084565b6136f8565b614f17565b614f6881611e67936136f8565b5f8260020b125f14614f9357614f6881611e67936136f8565b614f6881614f63614fa782611e679661209f565b613340565b6117fa6117db6117d26117c96117c4611e6795614fc761480d565b614ebe565b90929091908015614ffb575f19810190811161145e57915b15614ff257611e6792615420565b611e67926153dd565b91614fe4565b61501c6150136150259261379f61480d565b6013549061372e565b60105490611472565b601154808211614ac9575090565b90670de0b6b3a76400008202905f19670de0b6b3a7640000840992828085109403938085039485841115610e4057146150c357670de0b6b3a764000082910981805f03168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b5091500490565b81810291905f1982820991838084109303928084039384600160601b1115610e40571461510a57600160601b910990828211900360a01b910360601c1790565b50505060601c90565b808202905f1983820990828083109203918083039283670de0b6b3a76400001115610e40571461517d577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac1066993670de0b6b3a7640000910990828211900360ee1b910360121c170290565b5050670de0b6b3a764000091500490565b808202905f1983820990828083109203918083039283620f42401115610e4057146151ee577fde8f6cefed634549b62c77574f722e1ac57e23f24d8fd5cb790fb65668c2613993620f4240910990828211900360fa1b910360061c170290565b5050620f424091500490565b90606082901b905f19600160601b840992828085109403938085039485841115610e4057146150c3578190600160601b900981805f03168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b91818302915f1981850993838086109503948086039586851115610e4057146152f5579082910981805f03168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b505091500490565b90615307916151fa565b6001600160a01b03811161532d57600160a01b811015613275576001600160a01b031690565b505f90565b615378612dab615348612ecb60a0612175611f3d565b60145460181c60ff16156153ac5760125460020b808260020b135f146153a557505b60125460181c60020b61335b565b61538a614824601154601054906115a1565b90811561371a57600160ff1b81145f1983141661145e570590565b905061536a565b60125460020b808260020b125f146153a5575061536a565b6001600160a01b03918216908216039190821161145e57565b611e67926154159290916001600160a01b038083169082161161541a575b6001600160a01b039161540e91906153c4565b16906151fa565b615474565b906153fb565b611e6792615415929091906001600160a01b038082169083161161546e575b6154676154586001600160a01b038381169085166150ca565b926001600160a01b03926153c4565b169161527d565b9061543f565b6001600160801b0381169190820361548857565b60405162461bcd60e51b81526020600482015260126024820152716c6971756964697479206f766572666c6f7760701b6044820152606490fdfe27db09392d7d230eb65a11bd84925fb8da90df8a067ca8a4fc2933b4f637262bb39221ace053465ec3453ce2b36430bd138b997ecea25c1043da0c366812b828b7c774451310d1be4108bc180d1b52823cb0ee0274a6c0081bcaf94f115fb96da164736f6c634300081a000a";
@@ -5928,7 +6042,8 @@ var weth9Abi = [
5928
6042
  stateMutability: "view"
5929
6043
  }
5930
6044
  ];
5931
- var rehypeDopplerHookAbi = [
6045
+ var rehypeDopplerHookInitializerAbi = [
6046
+ ...feesManagerAbi,
5932
6047
  {
5933
6048
  type: "function",
5934
6049
  name: "INITIALIZER",
@@ -6071,10 +6186,170 @@ var rehypeDopplerHookAbi = [
6071
6186
  outputs: [{ name: "", type: "address", internalType: "contract Quoter" }],
6072
6187
  stateMutability: "view"
6073
6188
  },
6189
+ {
6190
+ type: "event",
6191
+ name: "AirlockOwnerFeesClaimed",
6192
+ inputs: [
6193
+ {
6194
+ name: "poolId",
6195
+ type: "bytes32",
6196
+ indexed: true,
6197
+ internalType: "PoolId"
6198
+ },
6199
+ {
6200
+ name: "airlockOwner",
6201
+ type: "address",
6202
+ indexed: true,
6203
+ internalType: "address"
6204
+ },
6205
+ {
6206
+ name: "fees0",
6207
+ type: "uint128",
6208
+ indexed: false,
6209
+ internalType: "uint128"
6210
+ },
6211
+ {
6212
+ name: "fees1",
6213
+ type: "uint128",
6214
+ indexed: false,
6215
+ internalType: "uint128"
6216
+ }
6217
+ ],
6218
+ anonymous: false
6219
+ },
6220
+ {
6221
+ type: "event",
6222
+ name: "FeeBeneficiariesSet",
6223
+ inputs: [
6224
+ {
6225
+ name: "poolId",
6226
+ type: "bytes32",
6227
+ indexed: true,
6228
+ internalType: "PoolId"
6229
+ },
6230
+ {
6231
+ name: "beneficiaries",
6232
+ type: "tuple[]",
6233
+ indexed: false,
6234
+ internalType: "struct BeneficiaryData[]",
6235
+ components: [
6236
+ {
6237
+ name: "beneficiary",
6238
+ type: "address",
6239
+ internalType: "address"
6240
+ },
6241
+ { name: "shares", type: "uint96", internalType: "uint96" }
6242
+ ]
6243
+ }
6244
+ ],
6245
+ anonymous: false
6246
+ },
6247
+ {
6248
+ type: "event",
6249
+ name: "FeeScheduleSet",
6250
+ inputs: [
6251
+ {
6252
+ name: "poolId",
6253
+ type: "bytes32",
6254
+ indexed: true,
6255
+ internalType: "PoolId"
6256
+ },
6257
+ {
6258
+ name: "startingTime",
6259
+ type: "uint32",
6260
+ indexed: false,
6261
+ internalType: "uint32"
6262
+ },
6263
+ {
6264
+ name: "startFee",
6265
+ type: "uint24",
6266
+ indexed: false,
6267
+ internalType: "uint24"
6268
+ },
6269
+ {
6270
+ name: "endFee",
6271
+ type: "uint24",
6272
+ indexed: false,
6273
+ internalType: "uint24"
6274
+ },
6275
+ {
6276
+ name: "durationSeconds",
6277
+ type: "uint32",
6278
+ indexed: false,
6279
+ internalType: "uint32"
6280
+ }
6281
+ ],
6282
+ anonymous: false
6283
+ },
6284
+ {
6285
+ type: "event",
6286
+ name: "FeeUpdated",
6287
+ inputs: [
6288
+ {
6289
+ name: "poolId",
6290
+ type: "bytes32",
6291
+ indexed: true,
6292
+ internalType: "PoolId"
6293
+ },
6294
+ {
6295
+ name: "fee",
6296
+ type: "uint24",
6297
+ indexed: false,
6298
+ internalType: "uint24"
6299
+ }
6300
+ ],
6301
+ anonymous: false
6302
+ },
6303
+ { type: "error", name: "FeeBeneficiariesNotConfigured", inputs: [] },
6304
+ {
6305
+ type: "error",
6306
+ name: "FeeBeneficiariesNotSupportedInDirectBuyback",
6307
+ inputs: []
6308
+ },
6074
6309
  { type: "error", name: "FeeDistributionMustAddUpToWAD", inputs: [] },
6310
+ {
6311
+ type: "error",
6312
+ name: "FeeTooHigh",
6313
+ inputs: [{ name: "fee", type: "uint24", internalType: "uint24" }]
6314
+ },
6315
+ { type: "error", name: "InsufficientFeeCurrency", inputs: [] },
6316
+ {
6317
+ type: "error",
6318
+ name: "InvalidDurationSeconds",
6319
+ inputs: [
6320
+ {
6321
+ name: "durationSeconds",
6322
+ type: "uint32",
6323
+ internalType: "uint32"
6324
+ }
6325
+ ]
6326
+ },
6327
+ {
6328
+ type: "error",
6329
+ name: "InvalidFeeRange",
6330
+ inputs: [
6331
+ { name: "startFee", type: "uint24", internalType: "uint24" },
6332
+ { name: "endFee", type: "uint24", internalType: "uint24" }
6333
+ ]
6334
+ },
6335
+ { type: "error", name: "InvalidProtocolOwnerBeneficiary", inputs: [] },
6336
+ {
6337
+ type: "error",
6338
+ name: "InvalidProtocolOwnerShares",
6339
+ inputs: [
6340
+ { name: "required", type: "uint96", internalType: "uint96" },
6341
+ { name: "provided", type: "uint96", internalType: "uint96" }
6342
+ ]
6343
+ },
6344
+ { type: "error", name: "InvalidShares", inputs: [] },
6345
+ { type: "error", name: "InvalidTotalShares", inputs: [] },
6346
+ { type: "error", name: "PoolAlreadyInitialized", inputs: [] },
6347
+ { type: "error", name: "Reentrancy", inputs: [] },
6075
6348
  { type: "error", name: "SenderNotAirlockOwner", inputs: [] },
6076
- { type: "error", name: "SenderNotInitializer", inputs: [] }
6349
+ { type: "error", name: "SenderNotInitializer", inputs: [] },
6350
+ { type: "error", name: "UnorderedBeneficiaries", inputs: [] }
6077
6351
  ];
6352
+ var rehypeDopplerHookAbi = rehypeDopplerHookInitializerAbi;
6078
6353
  var rehypeDopplerHookMigratorAbi = [
6079
6354
  {
6080
6355
  type: "function",
@@ -6798,8 +7073,6 @@ function isToken0Expected(numeraire) {
6798
7073
  return false;
6799
7074
  }
6800
7075
  }
6801
-
6802
- // src/evm/utils/beneficiaries.ts
6803
7076
  function sortBeneficiaries(beneficiaries) {
6804
7077
  const sorted = [...beneficiaries].sort((a, b) => {
6805
7078
  const aAddr = a.beneficiary.toLowerCase();
@@ -6813,62 +7086,369 @@ function sortBeneficiaries(beneficiaries) {
6813
7086
  );
6814
7087
  }
6815
7088
  }
6816
- return sorted;
7089
+ return sorted;
7090
+ }
7091
+ function normalizeBeneficiaries(beneficiaries, label) {
7092
+ const sorted = sortBeneficiaries(beneficiaries);
7093
+ if (!isNonEmpty(sorted)) {
7094
+ throw new Error(`${label} list must not be empty`);
7095
+ }
7096
+ let totalShares = 0n;
7097
+ for (const beneficiary of sorted) {
7098
+ if (!isAddress(beneficiary.beneficiary, { strict: false })) {
7099
+ throw new Error(
7100
+ `${label} address is invalid: ${beneficiary.beneficiary}`
7101
+ );
7102
+ }
7103
+ if (beneficiary.beneficiary.toLowerCase() === zeroAddress) {
7104
+ throw new Error(`${label} address cannot be the zero address`);
7105
+ }
7106
+ if (beneficiary.shares <= 0n) {
7107
+ throw new Error(`${label} shares must be positive`);
7108
+ }
7109
+ totalShares += beneficiary.shares;
7110
+ }
7111
+ if (totalShares !== WAD) {
7112
+ throw new Error(
7113
+ `${label} shares must sum to ${WAD} (100%), but got ${totalShares}`
7114
+ );
7115
+ }
7116
+ return sorted;
7117
+ }
7118
+ function isNonEmpty(values) {
7119
+ return values.length > 0;
7120
+ }
7121
+
7122
+ // src/evm/types.ts
7123
+ var NO_OP_ENABLED_CHAIN_IDS = [
7124
+ CHAIN_IDS.MAINNET,
7125
+ CHAIN_IDS.ETH_SEPOLIA,
7126
+ CHAIN_IDS.BASE,
7127
+ CHAIN_IDS.BASE_SEPOLIA,
7128
+ CHAIN_IDS.UNICHAIN,
7129
+ CHAIN_IDS.UNICHAIN_SEPOLIA,
7130
+ CHAIN_IDS.ROBINHOOD,
7131
+ CHAIN_IDS.MONAD_TESTNET,
7132
+ CHAIN_IDS.MONAD_MAINNET
7133
+ ];
7134
+ function isNoOpEnabledChain(chainId) {
7135
+ return NO_OP_ENABLED_CHAIN_IDS.includes(chainId);
7136
+ }
7137
+ var LAUNCHPAD_ENABLED_CHAIN_IDS = [
7138
+ CHAIN_IDS.MAINNET,
7139
+ CHAIN_IDS.BASE,
7140
+ CHAIN_IDS.BASE_SEPOLIA,
7141
+ CHAIN_IDS.ROBINHOOD,
7142
+ CHAIN_IDS.MONAD_MAINNET
7143
+ ];
7144
+ function isLaunchpadEnabledChain(chainId) {
7145
+ return LAUNCHPAD_ENABLED_CHAIN_IDS.includes(chainId);
7146
+ }
7147
+ var LockablePoolStatus = /* @__PURE__ */ ((LockablePoolStatus2) => {
7148
+ LockablePoolStatus2[LockablePoolStatus2["Uninitialized"] = 0] = "Uninitialized";
7149
+ LockablePoolStatus2[LockablePoolStatus2["Initialized"] = 1] = "Initialized";
7150
+ LockablePoolStatus2[LockablePoolStatus2["Locked"] = 2] = "Locked";
7151
+ LockablePoolStatus2[LockablePoolStatus2["Exited"] = 3] = "Exited";
7152
+ return LockablePoolStatus2;
7153
+ })(LockablePoolStatus || {});
7154
+ var OpeningAuctionPhase = /* @__PURE__ */ ((OpeningAuctionPhase2) => {
7155
+ OpeningAuctionPhase2[OpeningAuctionPhase2["NotStarted"] = 0] = "NotStarted";
7156
+ OpeningAuctionPhase2[OpeningAuctionPhase2["Active"] = 1] = "Active";
7157
+ OpeningAuctionPhase2[OpeningAuctionPhase2["Closed"] = 2] = "Closed";
7158
+ OpeningAuctionPhase2[OpeningAuctionPhase2["Settled"] = 3] = "Settled";
7159
+ return OpeningAuctionPhase2;
7160
+ })(OpeningAuctionPhase || {});
7161
+ var OpeningAuctionStatus = /* @__PURE__ */ ((OpeningAuctionStatus2) => {
7162
+ OpeningAuctionStatus2[OpeningAuctionStatus2["Uninitialized"] = 0] = "Uninitialized";
7163
+ OpeningAuctionStatus2[OpeningAuctionStatus2["AuctionActive"] = 1] = "AuctionActive";
7164
+ OpeningAuctionStatus2[OpeningAuctionStatus2["DopplerActive"] = 2] = "DopplerActive";
7165
+ OpeningAuctionStatus2[OpeningAuctionStatus2["Exited"] = 3] = "Exited";
7166
+ return OpeningAuctionStatus2;
7167
+ })(OpeningAuctionStatus || {});
7168
+ var RehypeFeeRoutingMode = /* @__PURE__ */ ((RehypeFeeRoutingMode2) => {
7169
+ RehypeFeeRoutingMode2[RehypeFeeRoutingMode2["DirectBuyback"] = 0] = "DirectBuyback";
7170
+ RehypeFeeRoutingMode2[RehypeFeeRoutingMode2["RouteToBeneficiaryFees"] = 1] = "RouteToBeneficiaryFees";
7171
+ return RehypeFeeRoutingMode2;
7172
+ })(RehypeFeeRoutingMode || {});
7173
+
7174
+ // src/evm/utils/rehypeFeeDistribution.ts
7175
+ function resolveRehypeFeeDistributionInfo(config) {
7176
+ const feeDistributionInfo = config.feeDistributionInfo ?? resolveLegacyFeeDistributionInfo(config);
7177
+ validateFeeDistributionInfo(feeDistributionInfo);
7178
+ return feeDistributionInfo;
7179
+ }
7180
+ function resolveLegacyFeeDistributionInfo(config) {
7181
+ const assetBuyback = config.assetBuybackPercentWad;
7182
+ const numeraireBuyback = config.numeraireBuybackPercentWad;
7183
+ const beneficiary = config.beneficiaryPercentWad;
7184
+ const lp = config.lpPercentWad;
7185
+ if (assetBuyback === void 0 || numeraireBuyback === void 0 || beneficiary === void 0 || lp === void 0) {
7186
+ throw new Error(
7187
+ "Rehype feeDistributionInfo is required, or provide all deprecated legacy percentages."
7188
+ );
7189
+ }
7190
+ return {
7191
+ assetFeesToAssetBuybackWad: assetBuyback,
7192
+ assetFeesToNumeraireBuybackWad: numeraireBuyback,
7193
+ assetFeesToBeneficiaryWad: beneficiary,
7194
+ assetFeesToLpWad: lp,
7195
+ numeraireFeesToAssetBuybackWad: assetBuyback,
7196
+ numeraireFeesToNumeraireBuybackWad: numeraireBuyback,
7197
+ numeraireFeesToBeneficiaryWad: beneficiary,
7198
+ numeraireFeesToLpWad: lp
7199
+ };
7200
+ }
7201
+ function validateFeeDistributionInfo(feeDistributionInfo) {
7202
+ if (feeDistributionInfo.assetFeesToAssetBuybackWad < 0n || feeDistributionInfo.assetFeesToNumeraireBuybackWad < 0n || feeDistributionInfo.assetFeesToBeneficiaryWad < 0n || feeDistributionInfo.assetFeesToLpWad < 0n) {
7203
+ throw new Error(
7204
+ "Rehype asset fee distribution cannot contain negative components"
7205
+ );
7206
+ }
7207
+ const assetRowTotal = feeDistributionInfo.assetFeesToAssetBuybackWad + feeDistributionInfo.assetFeesToNumeraireBuybackWad + feeDistributionInfo.assetFeesToBeneficiaryWad + feeDistributionInfo.assetFeesToLpWad;
7208
+ if (assetRowTotal !== WAD) {
7209
+ throw new Error(
7210
+ `Rehype asset fee distribution must sum to ${WAD} (100%), but got ${assetRowTotal}`
7211
+ );
7212
+ }
7213
+ if (feeDistributionInfo.numeraireFeesToAssetBuybackWad < 0n || feeDistributionInfo.numeraireFeesToNumeraireBuybackWad < 0n || feeDistributionInfo.numeraireFeesToBeneficiaryWad < 0n || feeDistributionInfo.numeraireFeesToLpWad < 0n) {
7214
+ throw new Error(
7215
+ "Rehype numeraire fee distribution cannot contain negative components"
7216
+ );
7217
+ }
7218
+ const numeraireRowTotal = feeDistributionInfo.numeraireFeesToAssetBuybackWad + feeDistributionInfo.numeraireFeesToNumeraireBuybackWad + feeDistributionInfo.numeraireFeesToBeneficiaryWad + feeDistributionInfo.numeraireFeesToLpWad;
7219
+ if (numeraireRowTotal !== WAD) {
7220
+ throw new Error(
7221
+ `Rehype numeraire fee distribution must sum to ${WAD} (100%), but got ${numeraireRowTotal}`
7222
+ );
7223
+ }
7224
+ }
7225
+
7226
+ // src/evm/utils/rehypeDopplerHookInitializer.ts
7227
+ function normalizeRehypeDopplerHookInitializerConfig(config) {
7228
+ assertNonZeroAddress(config.hookAddress, "Rehype hookAddress");
7229
+ const feeBeneficiaries = config.feeBeneficiaries;
7230
+ if (feeBeneficiaries !== void 0 && config.buybackDestination !== void 0) {
7231
+ throw new Error(
7232
+ "Rehype buybackDestination and feeBeneficiaries are mutually exclusive"
7233
+ );
7234
+ }
7235
+ const feeDistributionInfo = resolveRehypeFeeDistributionInfo(config);
7236
+ const { startFee, endFee, durationSeconds, startingTime } = normalizeFeeSchedule(config);
7237
+ const feeRoutingMode = feeBeneficiaries !== void 0 ? normalizeBeneficiaryFeeRoutingMode(config.feeRoutingMode) : normalizeFeeRoutingMode(config.feeRoutingMode);
7238
+ const common = {
7239
+ hookAddress: config.hookAddress,
7240
+ startFee,
7241
+ endFee,
7242
+ durationSeconds,
7243
+ startingTime,
7244
+ feeDistributionInfo,
7245
+ graduationCalldata: config.graduationCalldata,
7246
+ graduationMarketCap: config.graduationMarketCap,
7247
+ numerairePrice: config.numerairePrice,
7248
+ farTick: config.farTick
7249
+ };
7250
+ if (feeBeneficiaries !== void 0) {
7251
+ const normalizedBeneficiaries = normalizeBeneficiaries(
7252
+ feeBeneficiaries,
7253
+ "Rehype fee beneficiary"
7254
+ );
7255
+ return {
7256
+ ...common,
7257
+ feeBeneficiaries: normalizedBeneficiaries,
7258
+ feeRoutingMode: 1 /* RouteToBeneficiaryFees */
7259
+ };
7260
+ }
7261
+ if (config.buybackDestination === void 0) {
7262
+ throw new Error(
7263
+ "Rehype requires either buybackDestination or feeBeneficiaries"
7264
+ );
7265
+ }
7266
+ assertNonZeroAddress(config.buybackDestination, "Rehype buybackDestination");
7267
+ return {
7268
+ ...common,
7269
+ buybackDestination: config.buybackDestination,
7270
+ feeRoutingMode
7271
+ };
7272
+ }
7273
+ function assertNonZeroAddress(address, label) {
7274
+ if (!isAddress(address, { strict: false }) || address.toLowerCase() === ZERO_ADDRESS) {
7275
+ throw new Error(`${label} must be a non-zero address`);
7276
+ }
7277
+ }
7278
+ function normalizeFeeRoutingMode(mode) {
7279
+ if (mode === void 0 || mode === 0 /* DirectBuyback */) {
7280
+ return 0 /* DirectBuyback */;
7281
+ }
7282
+ if (mode === 1 /* RouteToBeneficiaryFees */) {
7283
+ return 1 /* RouteToBeneficiaryFees */;
7284
+ }
7285
+ if (mode === "directBuyback") {
7286
+ return 0 /* DirectBuyback */;
7287
+ }
7288
+ if (mode === "routeToBeneficiaryFees") {
7289
+ return 1 /* RouteToBeneficiaryFees */;
7290
+ }
7291
+ throw new Error("Unsupported Rehype feeRoutingMode");
7292
+ }
7293
+ function normalizeBeneficiaryFeeRoutingMode(mode) {
7294
+ if (mode === void 0 || mode === 1 /* RouteToBeneficiaryFees */ || mode === "routeToBeneficiaryFees") {
7295
+ return 1 /* RouteToBeneficiaryFees */;
7296
+ }
7297
+ throw new Error(
7298
+ "Rehype fee beneficiaries are incompatible with DirectBuyback routing"
7299
+ );
7300
+ }
7301
+ function normalizeFeeSchedule(config) {
7302
+ const maxRehypeFee = DECAY_MAX_START_FEE;
7303
+ const startFeeRaw = config.startFee ?? config.customFee;
7304
+ if (startFeeRaw === void 0) {
7305
+ throw new Error(
7306
+ "Rehype startFee is required, or provide deprecated customFee."
7307
+ );
7308
+ }
7309
+ const startFee = Number(startFeeRaw);
7310
+ const endFee = Number(config.endFee ?? startFee);
7311
+ if (!Number.isInteger(startFee) || startFee < 0 || startFee > maxRehypeFee) {
7312
+ throw new Error(
7313
+ `Rehype startFee must be an integer between 0 and ${maxRehypeFee}`
7314
+ );
7315
+ }
7316
+ if (!Number.isInteger(endFee) || endFee < 0 || endFee > maxRehypeFee) {
7317
+ throw new Error(
7318
+ `Rehype endFee must be an integer between 0 and ${maxRehypeFee}`
7319
+ );
7320
+ }
7321
+ if (startFee < endFee) {
7322
+ throw new Error(
7323
+ `Rehype startFee (${startFee}) must be greater than or equal to endFee (${endFee})`
7324
+ );
7325
+ }
7326
+ const durationRaw = config.durationSeconds ?? (startFee === endFee ? 0 : void 0);
7327
+ if (durationRaw === void 0) {
7328
+ throw new Error(
7329
+ "Rehype durationSeconds must be provided when startFee is greater than endFee."
7330
+ );
7331
+ }
7332
+ const durationSeconds = normalizeUint32(
7333
+ durationRaw,
7334
+ "Rehype durationSeconds"
7335
+ );
7336
+ if (startFee > endFee && durationSeconds === 0) {
7337
+ throw new Error(
7338
+ "Rehype durationSeconds must be greater than 0 when startFee is greater than endFee."
7339
+ );
7340
+ }
7341
+ const startingTimeValue = config.startingTime;
7342
+ const startingTime = startingTimeValue === void 0 ? 0 : normalizeUint32(
7343
+ startingTimeValue instanceof Date ? Math.floor(startingTimeValue.getTime() / 1e3) : startingTimeValue,
7344
+ "Rehype startingTime"
7345
+ );
7346
+ return { startFee, endFee, durationSeconds, startingTime };
7347
+ }
7348
+ function normalizeUint32(value, label) {
7349
+ const normalized = Number(value);
7350
+ if (!Number.isFinite(normalized) || !Number.isInteger(normalized)) {
7351
+ throw new Error(`${label} must be an integer number of seconds`);
7352
+ }
7353
+ if (normalized < 0) {
7354
+ throw new Error(`${label} cannot be negative`);
7355
+ }
7356
+ if (normalized > 4294967295) {
7357
+ throw new Error(`${label} must fit within uint32`);
7358
+ }
7359
+ return normalized;
7360
+ }
7361
+ function encodeRehypeDopplerHookInitializerData(numeraire, config, chainId) {
7362
+ if (chainId === CHAIN_IDS.BASE_SEPOLIA) {
7363
+ return encodeAbiParameters(rehypeInitializerDataAbi, [
7364
+ {
7365
+ numeraire,
7366
+ buybackDst: config.buybackDestination ?? ZERO_ADDRESS,
7367
+ startFee: config.startFee,
7368
+ endFee: config.endFee,
7369
+ durationSeconds: config.durationSeconds,
7370
+ startingTime: config.startingTime,
7371
+ feeRoutingMode: config.feeRoutingMode,
7372
+ feeDistributionInfo: config.feeDistributionInfo,
7373
+ feeBeneficiaries: config.feeBeneficiaries ?? []
7374
+ }
7375
+ ]);
7376
+ }
7377
+ if (config.feeBeneficiaries !== void 0) {
7378
+ throw new Error(
7379
+ "Rehype fee beneficiaries are temporarily supported only on Base Sepolia until the remaining initializer deployments are upgraded"
7380
+ );
7381
+ }
7382
+ return encodeAbiParameters(legacyRehypeInitializerDataAbi, [
7383
+ {
7384
+ numeraire,
7385
+ buybackDst: config.buybackDestination,
7386
+ startFee: config.startFee,
7387
+ endFee: config.endFee,
7388
+ durationSeconds: config.durationSeconds,
7389
+ startingTime: config.startingTime,
7390
+ feeRoutingMode: config.feeRoutingMode,
7391
+ feeDistributionInfo: config.feeDistributionInfo
7392
+ }
7393
+ ]);
6817
7394
  }
6818
-
6819
- // src/evm/types.ts
6820
- var NO_OP_ENABLED_CHAIN_IDS = [
6821
- CHAIN_IDS.MAINNET,
6822
- CHAIN_IDS.ETH_SEPOLIA,
6823
- CHAIN_IDS.BASE,
6824
- CHAIN_IDS.BASE_SEPOLIA,
6825
- CHAIN_IDS.UNICHAIN,
6826
- CHAIN_IDS.UNICHAIN_SEPOLIA,
6827
- CHAIN_IDS.ROBINHOOD,
6828
- CHAIN_IDS.MONAD_TESTNET,
6829
- CHAIN_IDS.MONAD_MAINNET
7395
+ var beneficiaryComponents = [
7396
+ { name: "beneficiary", type: "address" },
7397
+ { name: "shares", type: "uint96" }
6830
7398
  ];
6831
- function isNoOpEnabledChain(chainId) {
6832
- return NO_OP_ENABLED_CHAIN_IDS.includes(chainId);
6833
- }
6834
- var LAUNCHPAD_ENABLED_CHAIN_IDS = [
6835
- CHAIN_IDS.MAINNET,
6836
- CHAIN_IDS.BASE,
6837
- CHAIN_IDS.BASE_SEPOLIA,
6838
- CHAIN_IDS.ROBINHOOD,
6839
- CHAIN_IDS.MONAD_MAINNET
7399
+ var feeDistributionComponents = [
7400
+ { name: "assetFeesToAssetBuybackWad", type: "uint256" },
7401
+ { name: "assetFeesToNumeraireBuybackWad", type: "uint256" },
7402
+ { name: "assetFeesToBeneficiaryWad", type: "uint256" },
7403
+ { name: "assetFeesToLpWad", type: "uint256" },
7404
+ { name: "numeraireFeesToAssetBuybackWad", type: "uint256" },
7405
+ { name: "numeraireFeesToNumeraireBuybackWad", type: "uint256" },
7406
+ { name: "numeraireFeesToBeneficiaryWad", type: "uint256" },
7407
+ { name: "numeraireFeesToLpWad", type: "uint256" }
7408
+ ];
7409
+ var legacyRehypeInitializerDataAbi = [
7410
+ {
7411
+ type: "tuple",
7412
+ components: [
7413
+ { name: "numeraire", type: "address" },
7414
+ { name: "buybackDst", type: "address" },
7415
+ { name: "startFee", type: "uint24" },
7416
+ { name: "endFee", type: "uint24" },
7417
+ { name: "durationSeconds", type: "uint32" },
7418
+ { name: "startingTime", type: "uint32" },
7419
+ { name: "feeRoutingMode", type: "uint8" },
7420
+ {
7421
+ name: "feeDistributionInfo",
7422
+ type: "tuple",
7423
+ components: feeDistributionComponents
7424
+ }
7425
+ ]
7426
+ }
7427
+ ];
7428
+ var rehypeInitializerDataAbi = [
7429
+ {
7430
+ type: "tuple",
7431
+ components: [
7432
+ { name: "numeraire", type: "address" },
7433
+ { name: "buybackDst", type: "address" },
7434
+ { name: "startFee", type: "uint24" },
7435
+ { name: "endFee", type: "uint24" },
7436
+ { name: "durationSeconds", type: "uint32" },
7437
+ { name: "startingTime", type: "uint32" },
7438
+ { name: "feeRoutingMode", type: "uint8" },
7439
+ {
7440
+ name: "feeDistributionInfo",
7441
+ type: "tuple",
7442
+ components: feeDistributionComponents
7443
+ },
7444
+ {
7445
+ name: "feeBeneficiaries",
7446
+ type: "tuple[]",
7447
+ components: beneficiaryComponents
7448
+ }
7449
+ ]
7450
+ }
6840
7451
  ];
6841
- function isLaunchpadEnabledChain(chainId) {
6842
- return LAUNCHPAD_ENABLED_CHAIN_IDS.includes(chainId);
6843
- }
6844
- var LockablePoolStatus = /* @__PURE__ */ ((LockablePoolStatus2) => {
6845
- LockablePoolStatus2[LockablePoolStatus2["Uninitialized"] = 0] = "Uninitialized";
6846
- LockablePoolStatus2[LockablePoolStatus2["Initialized"] = 1] = "Initialized";
6847
- LockablePoolStatus2[LockablePoolStatus2["Locked"] = 2] = "Locked";
6848
- LockablePoolStatus2[LockablePoolStatus2["Exited"] = 3] = "Exited";
6849
- return LockablePoolStatus2;
6850
- })(LockablePoolStatus || {});
6851
- var OpeningAuctionPhase = /* @__PURE__ */ ((OpeningAuctionPhase2) => {
6852
- OpeningAuctionPhase2[OpeningAuctionPhase2["NotStarted"] = 0] = "NotStarted";
6853
- OpeningAuctionPhase2[OpeningAuctionPhase2["Active"] = 1] = "Active";
6854
- OpeningAuctionPhase2[OpeningAuctionPhase2["Closed"] = 2] = "Closed";
6855
- OpeningAuctionPhase2[OpeningAuctionPhase2["Settled"] = 3] = "Settled";
6856
- return OpeningAuctionPhase2;
6857
- })(OpeningAuctionPhase || {});
6858
- var OpeningAuctionStatus = /* @__PURE__ */ ((OpeningAuctionStatus2) => {
6859
- OpeningAuctionStatus2[OpeningAuctionStatus2["Uninitialized"] = 0] = "Uninitialized";
6860
- OpeningAuctionStatus2[OpeningAuctionStatus2["AuctionActive"] = 1] = "AuctionActive";
6861
- OpeningAuctionStatus2[OpeningAuctionStatus2["DopplerActive"] = 2] = "DopplerActive";
6862
- OpeningAuctionStatus2[OpeningAuctionStatus2["Exited"] = 3] = "Exited";
6863
- return OpeningAuctionStatus2;
6864
- })(OpeningAuctionStatus || {});
6865
- var RehypeFeeRoutingMode = /* @__PURE__ */ ((RehypeFeeRoutingMode2) => {
6866
- RehypeFeeRoutingMode2[RehypeFeeRoutingMode2["DirectBuyback"] = 0] = "DirectBuyback";
6867
- RehypeFeeRoutingMode2[RehypeFeeRoutingMode2["RouteToBeneficiaryFees"] = 1] = "RouteToBeneficiaryFees";
6868
- return RehypeFeeRoutingMode2;
6869
- })(RehypeFeeRoutingMode || {});
6870
-
6871
- // src/evm/utils/dopplerHookMigrator.ts
6872
7452
  function normalizeRehypeFeeRoutingMode(mode) {
6873
7453
  if (mode === void 0 || mode === 0 /* DirectBuyback */) {
6874
7454
  return 0 /* DirectBuyback */;
@@ -6886,7 +7466,7 @@ function normalizeRehypeFeeRoutingMode(mode) {
6886
7466
  "Rehype feeRoutingMode must be DirectBuyback/directBuyback or RouteToBeneficiaryFees/routeToBeneficiaryFees"
6887
7467
  );
6888
7468
  }
6889
- function resolveRehypeFeeDistributionInfo(config) {
7469
+ function resolveRehypeFeeDistributionInfo2(config) {
6890
7470
  if (config.feeDistributionInfo) {
6891
7471
  return config.feeDistributionInfo;
6892
7472
  }
@@ -6931,7 +7511,7 @@ function normalizeRehypeDopplerHookMigratorConfig(config) {
6931
7511
  if (config.customFee > 1e6) {
6932
7512
  throw new Error("Rehype customFee must be <= 1000000 (100%)");
6933
7513
  }
6934
- const feeDistributionInfo = resolveRehypeFeeDistributionInfo(config);
7514
+ const feeDistributionInfo = resolveRehypeFeeDistributionInfo2(config);
6935
7515
  validateRehypeFeeDistributionInfo(feeDistributionInfo);
6936
7516
  return {
6937
7517
  buybackDestination: config.buybackDestination,
@@ -10106,68 +10686,6 @@ var DopplerFactory = class {
10106
10686
  }
10107
10687
  return normalized;
10108
10688
  }
10109
- normalizeRehypeStartingTime(value, label) {
10110
- if (value === void 0) return 0;
10111
- if (value instanceof Date) {
10112
- return this.normalizeUint32(Math.floor(value.getTime() / 1e3), label);
10113
- }
10114
- return this.normalizeUint32(value, label);
10115
- }
10116
- normalizeRehypeFeeRoutingMode(mode) {
10117
- if (mode === void 0 || mode === 0 /* DirectBuyback */) {
10118
- return 0 /* DirectBuyback */;
10119
- }
10120
- if (mode === 1 /* RouteToBeneficiaryFees */) {
10121
- return 1 /* RouteToBeneficiaryFees */;
10122
- }
10123
- if (mode === "directBuyback") {
10124
- return 0 /* DirectBuyback */;
10125
- }
10126
- if (mode === "routeToBeneficiaryFees") {
10127
- return 1 /* RouteToBeneficiaryFees */;
10128
- }
10129
- throw new Error(
10130
- "Rehype feeRoutingMode must be DirectBuyback/directBuyback or RouteToBeneficiaryFees/routeToBeneficiaryFees"
10131
- );
10132
- }
10133
- resolveRehypeFeeDistributionInfo(config) {
10134
- if (config.feeDistributionInfo) {
10135
- return config.feeDistributionInfo;
10136
- }
10137
- const assetBuyback = config.assetBuybackPercentWad;
10138
- const numeraireBuyback = config.numeraireBuybackPercentWad;
10139
- const beneficiary = config.beneficiaryPercentWad;
10140
- const lp = config.lpPercentWad;
10141
- if (assetBuyback === void 0 || numeraireBuyback === void 0 || beneficiary === void 0 || lp === void 0) {
10142
- throw new Error(
10143
- "Rehype feeDistributionInfo is required, or provide all deprecated legacy percentages."
10144
- );
10145
- }
10146
- return {
10147
- assetFeesToAssetBuybackWad: assetBuyback,
10148
- assetFeesToNumeraireBuybackWad: numeraireBuyback,
10149
- assetFeesToBeneficiaryWad: beneficiary,
10150
- assetFeesToLpWad: lp,
10151
- numeraireFeesToAssetBuybackWad: assetBuyback,
10152
- numeraireFeesToNumeraireBuybackWad: numeraireBuyback,
10153
- numeraireFeesToBeneficiaryWad: beneficiary,
10154
- numeraireFeesToLpWad: lp
10155
- };
10156
- }
10157
- validateRehypeFeeDistributionInfo(feeDistributionInfo) {
10158
- const assetRowTotal = feeDistributionInfo.assetFeesToAssetBuybackWad + feeDistributionInfo.assetFeesToNumeraireBuybackWad + feeDistributionInfo.assetFeesToBeneficiaryWad + feeDistributionInfo.assetFeesToLpWad;
10159
- if (assetRowTotal !== WAD) {
10160
- throw new Error(
10161
- `Rehype asset fee distribution must sum to ${WAD} (100%), but got ${assetRowTotal}`
10162
- );
10163
- }
10164
- const numeraireRowTotal = feeDistributionInfo.numeraireFeesToAssetBuybackWad + feeDistributionInfo.numeraireFeesToNumeraireBuybackWad + feeDistributionInfo.numeraireFeesToBeneficiaryWad + feeDistributionInfo.numeraireFeesToLpWad;
10165
- if (numeraireRowTotal !== WAD) {
10166
- throw new Error(
10167
- `Rehype numeraire fee distribution must sum to ${WAD} (100%), but got ${numeraireRowTotal}`
10168
- );
10169
- }
10170
- }
10171
10689
  validateV4StreamableFeesConfig(streamableFees, label, required = false) {
10172
10690
  if (!streamableFees) {
10173
10691
  if (required) {
@@ -10216,69 +10734,6 @@ var DopplerFactory = class {
10216
10734
  );
10217
10735
  }
10218
10736
  }
10219
- normalizeRehypeHookConfig(config) {
10220
- const MAX_REHYPE_FEE = 1e6;
10221
- const startFeeRaw = config.startFee ?? config.customFee;
10222
- if (startFeeRaw === void 0) {
10223
- throw new Error(
10224
- "Rehype startFee is required, or provide deprecated customFee."
10225
- );
10226
- }
10227
- const endFeeRaw = config.endFee ?? startFeeRaw;
10228
- const startFee = Number(startFeeRaw);
10229
- const endFee = Number(endFeeRaw);
10230
- if (!Number.isInteger(startFee) || startFee < 0 || startFee > MAX_REHYPE_FEE) {
10231
- throw new Error(
10232
- `Rehype startFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
10233
- );
10234
- }
10235
- if (!Number.isInteger(endFee) || endFee < 0 || endFee > MAX_REHYPE_FEE) {
10236
- throw new Error(
10237
- `Rehype endFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
10238
- );
10239
- }
10240
- if (startFee < endFee) {
10241
- throw new Error(
10242
- `Rehype startFee (${startFee}) must be greater than or equal to endFee (${endFee})`
10243
- );
10244
- }
10245
- const durationRaw = config.durationSeconds ?? (startFee === endFee ? 0 : void 0);
10246
- if (durationRaw === void 0) {
10247
- throw new Error(
10248
- "Rehype durationSeconds must be provided when startFee is greater than endFee."
10249
- );
10250
- }
10251
- const durationSeconds = this.normalizeUint32(
10252
- durationRaw,
10253
- "Rehype durationSeconds"
10254
- );
10255
- if (startFee > endFee && durationSeconds <= 0) {
10256
- throw new Error(
10257
- "Rehype durationSeconds must be greater than 0 when startFee is greater than endFee."
10258
- );
10259
- }
10260
- const startingTime = this.normalizeRehypeStartingTime(
10261
- config.startingTime,
10262
- "Rehype startingTime"
10263
- );
10264
- const feeRoutingMode = this.normalizeRehypeFeeRoutingMode(
10265
- config.feeRoutingMode
10266
- );
10267
- const feeDistributionInfo = this.resolveRehypeFeeDistributionInfo(config);
10268
- this.validateRehypeFeeDistributionInfo(feeDistributionInfo);
10269
- return {
10270
- hookAddress: config.hookAddress,
10271
- buybackDestination: config.buybackDestination,
10272
- startFee,
10273
- endFee,
10274
- durationSeconds,
10275
- startingTime,
10276
- feeRoutingMode,
10277
- feeDistributionInfo,
10278
- graduationCalldata: config.graduationCalldata,
10279
- farTick: config.farTick
10280
- };
10281
- }
10282
10737
  resolveMulticurveInitializerMode(params) {
10283
10738
  const legacySchedule = params.schedule;
10284
10739
  const legacyHook = params.dopplerHook;
@@ -10436,14 +10891,16 @@ var DopplerFactory = class {
10436
10891
  const useScheduledInitializer = initializerMode.type === "scheduled";
10437
10892
  const useDecayInitializer = initializerMode.type === "decay";
10438
10893
  const useDopplerHookInitializer = initializerMode.type === "rehype";
10439
- const normalizedRehypeHookConfig = initializerMode.type === "rehype" && initializerMode.hookConfig ? this.normalizeRehypeHookConfig(initializerMode.hookConfig) : void 0;
10894
+ const normalizedRehypeHookConfig = initializerMode.type === "rehype" && initializerMode.hookConfig ? normalizeRehypeDopplerHookInitializerConfig(
10895
+ initializerMode.hookConfig
10896
+ ) : void 0;
10440
10897
  const curveComponents = [
10441
10898
  { type: "int24", name: "tickLower" },
10442
10899
  { type: "int24", name: "tickUpper" },
10443
10900
  { type: "uint16", name: "numPositions" },
10444
10901
  { type: "uint256", name: "shares" }
10445
10902
  ];
10446
- const beneficiaryComponents = [
10903
+ const beneficiaryComponents2 = [
10447
10904
  { type: "address", name: "beneficiary" },
10448
10905
  { type: "uint96", name: "shares" }
10449
10906
  ];
@@ -10476,44 +10933,10 @@ var DopplerFactory = class {
10476
10933
  let dopplerHookAddress = ZERO_ADDRESS;
10477
10934
  if (hookConfig) {
10478
10935
  dopplerHookAddress = hookConfig.hookAddress;
10479
- const feeDistributionComponents = [
10480
- { name: "assetFeesToAssetBuybackWad", type: "uint256" },
10481
- { name: "assetFeesToNumeraireBuybackWad", type: "uint256" },
10482
- { name: "assetFeesToBeneficiaryWad", type: "uint256" },
10483
- { name: "assetFeesToLpWad", type: "uint256" },
10484
- { name: "numeraireFeesToAssetBuybackWad", type: "uint256" },
10485
- { name: "numeraireFeesToNumeraireBuybackWad", type: "uint256" },
10486
- { name: "numeraireFeesToBeneficiaryWad", type: "uint256" },
10487
- { name: "numeraireFeesToLpWad", type: "uint256" }
10488
- ];
10489
- const rehypeInitDataComponents = [
10490
- { name: "numeraire", type: "address" },
10491
- { name: "buybackDst", type: "address" },
10492
- { name: "startFee", type: "uint24" },
10493
- { name: "endFee", type: "uint24" },
10494
- { name: "durationSeconds", type: "uint32" },
10495
- { name: "startingTime", type: "uint32" },
10496
- { name: "feeRoutingMode", type: "uint8" },
10497
- {
10498
- name: "feeDistributionInfo",
10499
- type: "tuple",
10500
- components: feeDistributionComponents
10501
- }
10502
- ];
10503
- onInitializationDopplerHookCalldata = encodeAbiParameters(
10504
- [{ type: "tuple", components: rehypeInitDataComponents }],
10505
- [
10506
- {
10507
- numeraire: params.sale.numeraire,
10508
- buybackDst: hookConfig.buybackDestination,
10509
- startFee: hookConfig.startFee,
10510
- endFee: hookConfig.endFee,
10511
- durationSeconds: hookConfig.durationSeconds,
10512
- startingTime: hookConfig.startingTime,
10513
- feeRoutingMode: hookConfig.feeRoutingMode,
10514
- feeDistributionInfo: hookConfig.feeDistributionInfo
10515
- }
10516
- ]
10936
+ onInitializationDopplerHookCalldata = encodeRehypeDopplerHookInitializerData(
10937
+ params.sale.numeraire,
10938
+ hookConfig,
10939
+ this.chainId
10517
10940
  );
10518
10941
  graduationDopplerHookCalldata = hookConfig.graduationCalldata ?? "0x";
10519
10942
  }
@@ -10525,7 +10948,7 @@ var DopplerFactory = class {
10525
10948
  {
10526
10949
  name: "beneficiaries",
10527
10950
  type: "tuple[]",
10528
- components: beneficiaryComponents
10951
+ components: beneficiaryComponents2
10529
10952
  },
10530
10953
  { name: "dopplerHook", type: "address" },
10531
10954
  { name: "onInitializationDopplerHookCalldata", type: "bytes" },
@@ -10556,7 +10979,7 @@ var DopplerFactory = class {
10556
10979
  {
10557
10980
  name: "beneficiaries",
10558
10981
  type: "tuple[]",
10559
- components: beneficiaryComponents
10982
+ components: beneficiaryComponents2
10560
10983
  },
10561
10984
  { name: "startingTime", type: "uint32" }
10562
10985
  ];
@@ -10590,7 +11013,7 @@ var DopplerFactory = class {
10590
11013
  {
10591
11014
  name: "beneficiaries",
10592
11015
  type: "tuple[]",
10593
- components: beneficiaryComponents
11016
+ components: beneficiaryComponents2
10594
11017
  },
10595
11018
  { name: "startingTime", type: "uint32" }
10596
11019
  ];
@@ -10614,7 +11037,7 @@ var DopplerFactory = class {
10614
11037
  {
10615
11038
  name: "beneficiaries",
10616
11039
  type: "tuple[]",
10617
- components: beneficiaryComponents
11040
+ components: beneficiaryComponents2
10618
11041
  }
10619
11042
  ];
10620
11043
  poolInitializerData = encodeAbiParameters(
@@ -12094,8 +12517,9 @@ var DopplerFactory = class {
12094
12517
  });
12095
12518
  }
12096
12519
  const numeraire = params.sale.numeraire;
12097
- const currency0 = tokenAddress < numeraire ? tokenAddress : numeraire;
12098
- const currency1 = tokenAddress < numeraire ? numeraire : tokenAddress;
12520
+ const tokenIsCurrency0 = BigInt(tokenAddress) < BigInt(numeraire);
12521
+ const currency0 = tokenIsCurrency0 ? tokenAddress : numeraire;
12522
+ const currency1 = tokenIsCurrency0 ? numeraire : tokenAddress;
12099
12523
  const fee = initializerMode.type === "decay" || initializerMode.type === "rehype" && initializerMode.hookConfig ? DYNAMIC_FEE_FLAG : params.pool.fee;
12100
12524
  return this.computePoolId({
12101
12525
  currency0,
@@ -13396,8 +13820,12 @@ function getTokenBatchSize(tokenBatchSize) {
13396
13820
  return tokenBatchSize;
13397
13821
  }
13398
13822
 
13399
- // src/evm/entities/auction/RehypeDopplerHook.ts
13400
- var RehypeDopplerHook = class {
13823
+ // src/evm/entities/auction/RehypeDopplerHookInitializer.ts
13824
+ var rehypeFeesManagerAbi = [
13825
+ ...feesManagerAbi,
13826
+ { type: "error", name: "FeeBeneficiariesNotConfigured", inputs: [] }
13827
+ ];
13828
+ var RehypeDopplerHookInitializer = class {
13401
13829
  client;
13402
13830
  walletClient;
13403
13831
  hookAddress;
@@ -13413,37 +13841,84 @@ var RehypeDopplerHook = class {
13413
13841
  return this.hookAddress;
13414
13842
  }
13415
13843
  async collectFees(asset) {
13416
- if (!this.walletClient) {
13417
- throw new Error("Wallet client required to collect rehype fees");
13418
- }
13844
+ const walletClient = this.requireWalletClient(
13845
+ "Wallet client required to collect rehype fees"
13846
+ );
13419
13847
  const { request, result } = await this.rpc.simulateContract({
13420
13848
  address: this.hookAddress,
13421
- abi: rehypeDopplerHookAbi,
13849
+ abi: rehypeDopplerHookInitializerAbi,
13422
13850
  functionName: "collectFees",
13423
13851
  args: [asset],
13424
- account: this.walletClient.account
13852
+ account: walletClient.account
13425
13853
  });
13426
- const hash = await this.walletClient.writeContract(request);
13854
+ const hash = await walletClient.writeContract(request);
13427
13855
  await this.rpc.waitForTransactionReceipt({ hash, confirmations: 1 });
13428
13856
  const decoded = decodeBalanceDelta(result);
13429
- return {
13430
- amount0: decoded.amount0,
13431
- amount1: decoded.amount1,
13432
- transactionHash: hash
13433
- };
13857
+ return { ...decoded, transactionHash: hash };
13434
13858
  }
13435
- async claimAirlockOwnerFees(asset) {
13436
- if (!this.walletClient) {
13437
- throw new Error("Wallet client required to claim rehype owner fees");
13859
+ /**
13860
+ * Collect fees and release the caller's pending beneficiary share.
13861
+ *
13862
+ * @returns The FeesManager `collectFees` return values and transaction hash.
13863
+ * The fee amounts are newly collected pool fees, not necessarily the caller's
13864
+ * beneficiary payout.
13865
+ */
13866
+ async claimFees(poolId) {
13867
+ const walletClient = this.requireWalletClient(
13868
+ "Wallet client required to claim rehype beneficiary fees"
13869
+ );
13870
+ const { request, result } = await this.rpc.simulateContract({
13871
+ address: this.hookAddress,
13872
+ abi: rehypeFeesManagerAbi,
13873
+ functionName: "collectFees",
13874
+ args: [poolId],
13875
+ account: walletClient.account
13876
+ });
13877
+ const hash = await walletClient.writeContract(request);
13878
+ await this.rpc.waitForTransactionReceipt({ hash, confirmations: 1 });
13879
+ const [fees0, fees1] = result;
13880
+ return { fees0, fees1, transactionHash: hash };
13881
+ }
13882
+ async getPendingFees(poolId, beneficiary) {
13883
+ const calls = createPendingFeePreviewCalls(
13884
+ this.hookAddress,
13885
+ poolId,
13886
+ beneficiary
13887
+ );
13888
+ return calculatePendingFees(await callAggregate3(this.rpc, calls));
13889
+ }
13890
+ async updateBeneficiary(poolId, newBeneficiary) {
13891
+ if (newBeneficiary.toLowerCase() === ZERO_ADDRESS) {
13892
+ throw new Error(
13893
+ "Rehype beneficiary cannot be updated to the zero address"
13894
+ );
13438
13895
  }
13896
+ const walletClient = this.requireWalletClient(
13897
+ "Wallet client required to update rehype beneficiary"
13898
+ );
13899
+ const { request } = await this.rpc.simulateContract({
13900
+ address: this.hookAddress,
13901
+ abi: feesManagerAbi,
13902
+ functionName: "updateBeneficiary",
13903
+ args: [poolId, newBeneficiary],
13904
+ account: walletClient.account
13905
+ });
13906
+ const hash = await walletClient.writeContract(request);
13907
+ await this.rpc.waitForTransactionReceipt({ hash, confirmations: 1 });
13908
+ return { transactionHash: hash };
13909
+ }
13910
+ async claimAirlockOwnerFees(asset) {
13911
+ const walletClient = this.requireWalletClient(
13912
+ "Wallet client required to claim rehype owner fees"
13913
+ );
13439
13914
  const { request, result } = await this.rpc.simulateContract({
13440
13915
  address: this.hookAddress,
13441
- abi: rehypeDopplerHookAbi,
13916
+ abi: rehypeDopplerHookInitializerAbi,
13442
13917
  functionName: "claimAirlockOwnerFees",
13443
13918
  args: [asset],
13444
- account: this.walletClient.account
13919
+ account: walletClient.account
13445
13920
  });
13446
- const hash = await this.walletClient.writeContract(request);
13921
+ const hash = await walletClient.writeContract(request);
13447
13922
  await this.rpc.waitForTransactionReceipt({ hash, confirmations: 1 });
13448
13923
  const [fees0, fees1] = result;
13449
13924
  return { fees0, fees1, transactionHash: hash };
@@ -13451,7 +13926,7 @@ var RehypeDopplerHook = class {
13451
13926
  async getFeeDistributionInfo(poolId) {
13452
13927
  const result = await this.rpc.readContract({
13453
13928
  address: this.hookAddress,
13454
- abi: rehypeDopplerHookAbi,
13929
+ abi: rehypeDopplerHookInitializerAbi,
13455
13930
  functionName: "getFeeDistributionInfo",
13456
13931
  args: [poolId]
13457
13932
  });
@@ -13460,7 +13935,7 @@ var RehypeDopplerHook = class {
13460
13935
  async getFeeRoutingMode(poolId) {
13461
13936
  const mode = await this.rpc.readContract({
13462
13937
  address: this.hookAddress,
13463
- abi: rehypeDopplerHookAbi,
13938
+ abi: rehypeDopplerHookInitializerAbi,
13464
13939
  functionName: "getFeeRoutingMode",
13465
13940
  args: [poolId]
13466
13941
  });
@@ -13469,7 +13944,7 @@ var RehypeDopplerHook = class {
13469
13944
  async getFeeSchedule(poolId) {
13470
13945
  const result = await this.rpc.readContract({
13471
13946
  address: this.hookAddress,
13472
- abi: rehypeDopplerHookAbi,
13947
+ abi: rehypeDopplerHookInitializerAbi,
13473
13948
  functionName: "getFeeSchedule",
13474
13949
  args: [poolId]
13475
13950
  });
@@ -13478,7 +13953,7 @@ var RehypeDopplerHook = class {
13478
13953
  async getHookFees(poolId) {
13479
13954
  const result = await this.rpc.readContract({
13480
13955
  address: this.hookAddress,
13481
- abi: rehypeDopplerHookAbi,
13956
+ abi: rehypeDopplerHookInitializerAbi,
13482
13957
  functionName: "getHookFees",
13483
13958
  args: [poolId]
13484
13959
  });
@@ -13487,14 +13962,23 @@ var RehypeDopplerHook = class {
13487
13962
  async getPoolInfo(poolId) {
13488
13963
  const result = await this.rpc.readContract({
13489
13964
  address: this.hookAddress,
13490
- abi: rehypeDopplerHookAbi,
13965
+ abi: rehypeDopplerHookInitializerAbi,
13491
13966
  functionName: "getPoolInfo",
13492
13967
  args: [poolId]
13493
13968
  });
13494
13969
  return normalizeRehypePoolInfo(result);
13495
13970
  }
13971
+ requireWalletClient(message) {
13972
+ if (!this.walletClient) {
13973
+ throw new Error(message);
13974
+ }
13975
+ return this.walletClient;
13976
+ }
13496
13977
  };
13497
13978
 
13979
+ // src/evm/entities/auction/RehypeDopplerHook.ts
13980
+ var RehypeDopplerHook = RehypeDopplerHookInitializer;
13981
+
13498
13982
  // src/evm/entities/auction/RehypeDopplerHookMigrator.ts
13499
13983
  var RehypeDopplerHookMigrator = class {
13500
13984
  client;
@@ -18318,7 +18802,7 @@ var MulticurveBuilder = class _MulticurveBuilder {
18318
18802
  }
18319
18803
  }
18320
18804
  /**
18321
- * Configure a RehypeDopplerHook for the pool.
18805
+ * Configure a RehypeDopplerHookInitializer for the pool.
18322
18806
  *
18323
18807
  * When configured, the hook will be initialized with the pool and will handle:
18324
18808
  * - Custom swap fees
@@ -18330,7 +18814,7 @@ var MulticurveBuilder = class _MulticurveBuilder {
18330
18814
  *
18331
18815
  * @example
18332
18816
  * ```typescript
18333
- * builder.withRehypeDopplerHook({
18817
+ * builder.withRehypeDopplerHookInitializer({
18334
18818
  * hookAddress: '0x...',
18335
18819
  * buybackDestination: '0x...',
18336
18820
  * startFee: 3000, // 0.3%
@@ -18349,153 +18833,21 @@ var MulticurveBuilder = class _MulticurveBuilder {
18349
18833
  * })
18350
18834
  * ```
18351
18835
  */
18352
- withRehypeDopplerHook(params) {
18836
+ withRehypeDopplerHookInitializer(params) {
18353
18837
  this.assertCanSetInitializer("rehype");
18354
- const feeDistributionInfo = this.resolveRehypeFeeDistributionInfo(params);
18355
- this.validateRehypeDistribution(feeDistributionInfo);
18356
- const { startFee, endFee, durationSeconds, startingTime, feeRoutingMode } = this.resolveRehypeFeeSchedule(params);
18357
18838
  if (params.graduationMarketCap !== void 0 && params.farTick !== void 0) {
18358
18839
  throw new Error(
18359
18840
  "Cannot specify both graduationMarketCap and farTick. Use one or the other."
18360
18841
  );
18361
18842
  }
18362
- const normalizedParams = {
18363
- ...params,
18364
- startFee,
18365
- endFee,
18366
- durationSeconds,
18367
- startingTime,
18368
- feeRoutingMode,
18369
- feeDistributionInfo
18370
- };
18843
+ const normalizedParams = normalizeRehypeDopplerHookInitializerConfig(params);
18371
18844
  this.dopplerHook = normalizedParams;
18372
18845
  this.initializer = { type: "rehype", config: normalizedParams };
18373
18846
  return this;
18374
18847
  }
18375
- parseUint32Value(value, label) {
18376
- const normalized = typeof value === "bigint" ? Number(value) : Number(value);
18377
- if (!Number.isFinite(normalized) || !Number.isInteger(normalized)) {
18378
- throw new Error(`${label} must be an integer number of seconds`);
18379
- }
18380
- if (normalized < 0) {
18381
- throw new Error(`${label} cannot be negative`);
18382
- }
18383
- const UINT32_MAX = 4294967295;
18384
- if (normalized > UINT32_MAX) {
18385
- throw new Error(`${label} must fit within uint32`);
18386
- }
18387
- return normalized;
18388
- }
18389
- normalizeRehypeFeeRoutingMode(mode) {
18390
- if (mode === void 0 || mode === 0 /* DirectBuyback */) {
18391
- return 0 /* DirectBuyback */;
18392
- }
18393
- if (mode === 1 /* RouteToBeneficiaryFees */) {
18394
- return 1 /* RouteToBeneficiaryFees */;
18395
- }
18396
- if (mode === "directBuyback") {
18397
- return 0 /* DirectBuyback */;
18398
- }
18399
- if (mode === "routeToBeneficiaryFees") {
18400
- return 1 /* RouteToBeneficiaryFees */;
18401
- }
18402
- throw new Error(
18403
- "Rehype feeRoutingMode must be DirectBuyback/directBuyback or RouteToBeneficiaryFees/routeToBeneficiaryFees"
18404
- );
18405
- }
18406
- resolveRehypeFeeDistributionInfo(params) {
18407
- if (params.feeDistributionInfo) {
18408
- return params.feeDistributionInfo;
18409
- }
18410
- const assetBuyback = params.assetBuybackPercentWad;
18411
- const numeraireBuyback = params.numeraireBuybackPercentWad;
18412
- const beneficiary = params.beneficiaryPercentWad;
18413
- const lp = params.lpPercentWad;
18414
- if (assetBuyback === void 0 || numeraireBuyback === void 0 || beneficiary === void 0 || lp === void 0) {
18415
- throw new Error(
18416
- "Rehype feeDistributionInfo is required, or provide all deprecated legacy percentages."
18417
- );
18418
- }
18419
- return {
18420
- assetFeesToAssetBuybackWad: assetBuyback,
18421
- assetFeesToNumeraireBuybackWad: numeraireBuyback,
18422
- assetFeesToBeneficiaryWad: beneficiary,
18423
- assetFeesToLpWad: lp,
18424
- numeraireFeesToAssetBuybackWad: assetBuyback,
18425
- numeraireFeesToNumeraireBuybackWad: numeraireBuyback,
18426
- numeraireFeesToBeneficiaryWad: beneficiary,
18427
- numeraireFeesToLpWad: lp
18428
- };
18429
- }
18430
- validateRehypeDistribution(feeDistributionInfo) {
18431
- const assetRowTotal = feeDistributionInfo.assetFeesToAssetBuybackWad + feeDistributionInfo.assetFeesToNumeraireBuybackWad + feeDistributionInfo.assetFeesToBeneficiaryWad + feeDistributionInfo.assetFeesToLpWad;
18432
- if (assetRowTotal !== WAD) {
18433
- throw new Error(
18434
- `Rehype asset fee distribution must sum to ${WAD} (100%), but got ${assetRowTotal}`
18435
- );
18436
- }
18437
- const numeraireRowTotal = feeDistributionInfo.numeraireFeesToAssetBuybackWad + feeDistributionInfo.numeraireFeesToNumeraireBuybackWad + feeDistributionInfo.numeraireFeesToBeneficiaryWad + feeDistributionInfo.numeraireFeesToLpWad;
18438
- if (numeraireRowTotal !== WAD) {
18439
- throw new Error(
18440
- `Rehype numeraire fee distribution must sum to ${WAD} (100%), but got ${numeraireRowTotal}`
18441
- );
18442
- }
18443
- }
18444
- resolveRehypeFeeSchedule(params) {
18445
- const MAX_REHYPE_FEE = 1e6;
18446
- const startFeeRaw = params.startFee ?? params.customFee;
18447
- if (startFeeRaw === void 0) {
18448
- throw new Error(
18449
- "Rehype startFee is required, or provide deprecated customFee."
18450
- );
18451
- }
18452
- const endFeeRaw = params.endFee ?? startFeeRaw;
18453
- const startFee = Number(startFeeRaw);
18454
- const endFee = Number(endFeeRaw);
18455
- if (!Number.isInteger(startFee) || startFee < 0 || startFee > MAX_REHYPE_FEE) {
18456
- throw new Error(
18457
- `Rehype startFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
18458
- );
18459
- }
18460
- if (!Number.isInteger(endFee) || endFee < 0 || endFee > MAX_REHYPE_FEE) {
18461
- throw new Error(
18462
- `Rehype endFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
18463
- );
18464
- }
18465
- if (startFee < endFee) {
18466
- throw new Error(
18467
- `Rehype startFee (${startFee}) must be greater than or equal to endFee (${endFee})`
18468
- );
18469
- }
18470
- const durationRaw = params.durationSeconds ?? (startFee === endFee ? 0 : void 0);
18471
- if (durationRaw === void 0) {
18472
- throw new Error(
18473
- "Rehype durationSeconds must be provided when startFee is greater than endFee."
18474
- );
18475
- }
18476
- const durationSeconds = this.parseUint32Value(
18477
- durationRaw,
18478
- "Rehype durationSeconds"
18479
- );
18480
- if (startFee > endFee && durationSeconds <= 0) {
18481
- throw new Error(
18482
- "Rehype durationSeconds must be greater than 0 when startFee is greater than endFee."
18483
- );
18484
- }
18485
- const startingTime = params.startingTime === void 0 ? 0 : this.parseStartTimeSeconds(
18486
- params.startingTime,
18487
- "Rehype startingTime"
18488
- );
18489
- const feeRoutingMode = this.normalizeRehypeFeeRoutingMode(
18490
- params.feeRoutingMode
18491
- );
18492
- return {
18493
- startFee,
18494
- endFee,
18495
- durationSeconds,
18496
- startingTime,
18497
- feeRoutingMode
18498
- };
18848
+ /** @deprecated Use withRehypeDopplerHookInitializer instead. */
18849
+ withRehypeDopplerHook(params) {
18850
+ return this.withRehypeDopplerHookInitializer(params);
18499
18851
  }
18500
18852
  withVesting(params) {
18501
18853
  if (!params) {
@@ -18772,7 +19124,7 @@ var MulticurveBuilder = class _MulticurveBuilder {
18772
19124
  const numerairePrice = dopplerHook.numerairePrice ?? this.numerairePrice;
18773
19125
  if (!numerairePrice) {
18774
19126
  throw new Error(
18775
- "graduationMarketCap requires numerairePrice. Either use withCurves() (which provides numerairePrice), or pass numerairePrice explicitly in withRehypeDopplerHook()."
19127
+ "graduationMarketCap requires numerairePrice. Either use withCurves() (which provides numerairePrice), or pass numerairePrice explicitly in withRehypeDopplerHookInitializer()."
18776
19128
  );
18777
19129
  }
18778
19130
  if (dopplerHook.graduationMarketCap <= 0) {
@@ -19297,16 +19649,20 @@ var DopplerSDK = class {
19297
19649
  return new DynamicAuction(this.publicClient, hookAddress);
19298
19650
  }
19299
19651
  /**
19300
- * Get a RehypeDopplerHook instance for interacting with initializer-side rehype hook state.
19652
+ * Get a RehypeDopplerHookInitializer instance.
19301
19653
  * @param hookAddress The address of the RehypeDopplerHookInitializer
19302
19654
  */
19303
- async getRehypeDopplerHook(hookAddress) {
19304
- return new RehypeDopplerHook(
19655
+ async getRehypeDopplerHookInitializer(hookAddress) {
19656
+ return new RehypeDopplerHookInitializer(
19305
19657
  this.publicClient,
19306
19658
  this.walletClient,
19307
19659
  hookAddress
19308
19660
  );
19309
19661
  }
19662
+ /** @deprecated Use getRehypeDopplerHookInitializer instead. */
19663
+ async getRehypeDopplerHook(hookAddress) {
19664
+ return this.getRehypeDopplerHookInitializer(hookAddress);
19665
+ }
19310
19666
  /**
19311
19667
  * Get a RehypeDopplerHookMigrator instance for interacting with migrator-side rehype hook state.
19312
19668
  * @param hookAddress The address of the RehypeDopplerHookMigrator
@@ -19489,6 +19845,6 @@ var DopplerSDK = class {
19489
19845
  // src/evm/index.ts
19490
19846
  var VERSION = "1.0.0";
19491
19847
 
19492
- export { ADDRESSES, 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_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, 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, dopplerERC20V1Abi, dopplerHookAbi, dopplerHookInitializerAbi, dopplerLensAbi, encodeRehypeDopplerHookMigratorCalldata, estimatePriceAtEpoch, estimateSlippage, feeClaimsInitializerAbi, 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, normalizePoolKey, openingAuctionAbi, openingAuctionInitializerAbi, openingAuctionPositionManagerAbi, poolManagerAbi, priceToSqrtPriceX96, priceToTick, quoterV2Abi, ratioToTick, rehypeDopplerHookAbi, rehypeDopplerHookMigratorAbi, resolveGasEstimate, sortBeneficiaries, sqrtPriceX96ToPrice, streamableFeesLockerAbi, streamableFeesLockerV2Abi, tickToMarketCap, tickToPrice, tokenPriceToRatio, topUpDistributorAbi, uniswapV2Router02Abi, uniswapV3InitializerAbi, uniswapV3PoolAbi, uniswapV4InitializerAbi, v2MigratorAbi, v3MigratorAbi, v4MigratorAbi, v4MulticurveInitializerAbi, v4MulticurveMigratorAbi, v4QuoterAbi, validateMarketCapParameters, weth9Abi };
19848
+ export { ADDRESSES, 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_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, 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, 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, weth9Abi };
19493
19849
  //# sourceMappingURL=index.js.map
19494
19850
  //# sourceMappingURL=index.js.map