@zoralabs/coins 1.1.2 → 2.1.0
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/.turbo/turbo-build.log +107 -110
- package/CHANGELOG.md +50 -0
- package/README.md +48 -1
- package/abis/BaseCoin.json +442 -0
- package/abis/BaseZoraV4CoinHook.json +6 -2
- package/abis/CoinTest.json +3 -246
- package/abis/CoinUniV4Test.json +20 -0
- package/abis/ContentCoinHook.json +6 -2
- package/abis/CreatorCoinHook.json +6 -2
- package/abis/FactoryTest.json +8 -133
- package/abis/FeeEstimatorHook.json +6 -2
- package/abis/HooksTest.json +0 -26
- package/abis/ICoin.json +378 -0
- package/abis/ICoinV3.json +378 -0
- package/abis/IZoraFactory.json +0 -18
- package/abis/IZoraV4CoinHook.json +2 -2
- package/abis/LiquidityMigrationTest.json +101 -0
- package/abis/MockBadFactory.json +15 -0
- package/abis/Ownable2StepUpgradeable.json +138 -0
- package/abis/ZoraFactoryImpl.json +38 -65
- package/addresses/8453.json +5 -5
- package/dist/index.cjs +272 -268
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +270 -266
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +397 -470
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/wagmiGenerated.ts +275 -271
- package/package.json +3 -3
- package/script/DeployPostDeploymentHooks.s.sol +2 -2
- package/script/TestBackingCoinSwap.s.sol +9 -9
- package/script/TestV4Swap.s.sol +9 -9
- package/script/UpgradeFactoryImpl.s.sol +0 -1
- package/src/BaseCoin.sol +109 -6
- package/src/ContentCoin.sol +45 -0
- package/src/CreatorCoin.sol +7 -5
- package/src/ZoraFactoryImpl.sol +12 -95
- package/src/deployment/CoinsDeployerBase.sol +13 -30
- package/src/hooks/BaseZoraV4CoinHook.sol +8 -6
- package/src/hooks/deployment/BuySupplyWithSwapRouterHook.sol +4 -5
- package/src/interfaces/ICoin.sol +67 -1
- package/src/interfaces/ICreatorCoin.sol +2 -2
- package/src/interfaces/IZoraFactory.sol +0 -5
- package/src/interfaces/IZoraV4CoinHook.sol +1 -1
- package/src/libs/CoinConfigurationVersions.sol +1 -39
- package/src/libs/CoinRewardsV4.sol +2 -2
- package/src/libs/CoinSetup.sol +1 -4
- package/src/libs/UniV4SwapHelper.sol +1 -1
- package/src/libs/UniV4SwapToCurrency.sol +2 -2
- package/src/libs/V4Liquidity.sol +1 -1
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/Coin.t.sol +112 -535
- package/test/CoinUniV4.t.sol +66 -10
- package/test/DeploymentHooks.t.sol +5 -102
- package/test/Factory.t.sol +49 -291
- package/test/LiquidityMigration.t.sol +160 -2
- package/test/MultiOwnable.t.sol +36 -36
- package/test/Upgrades.t.sol +23 -42
- package/test/utils/BaseTest.sol +39 -84
- package/test/utils/FeeEstimatorHook.sol +3 -3
- package/wagmi.config.ts +2 -2
- package/abis/Coin.json +0 -1912
- package/abis/DopplerUniswapV3Test.json +0 -800
- package/abis/ICoinV4.json +0 -1048
- package/abis/Simulate.json +0 -29
- package/abis/UniV3BuySell.json +0 -12
- package/abis/UniV3Errors.json +0 -32
- package/script/Simulate.s.sol +0 -59
- package/src/Coin.sol +0 -236
- package/src/CoinV4.sol +0 -151
- package/src/interfaces/ICoinV4.sol +0 -74
- package/src/libs/CoinDopplerUniV3.sol +0 -50
- package/src/libs/CoinRewards.sol +0 -201
- package/src/libs/CoinSetupV3.sol +0 -50
- package/src/libs/UniV3BuySell.sol +0 -231
- package/src/libs/UniV3Errors.sol +0 -11
- package/test/CoinDopplerUniV3.t.sol +0 -310
- /package/abis/{CoinV4.json → ContentCoin.json} +0 -0
package/abis/BaseCoin.json
CHANGED
|
@@ -239,6 +239,299 @@
|
|
|
239
239
|
],
|
|
240
240
|
"stateMutability": "view"
|
|
241
241
|
},
|
|
242
|
+
{
|
|
243
|
+
"type": "function",
|
|
244
|
+
"name": "getPayoutSwapPath",
|
|
245
|
+
"inputs": [
|
|
246
|
+
{
|
|
247
|
+
"name": "coinVersionLookup",
|
|
248
|
+
"type": "address",
|
|
249
|
+
"internalType": "contract IDeployedCoinVersionLookup"
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"outputs": [
|
|
253
|
+
{
|
|
254
|
+
"name": "payoutSwapPath",
|
|
255
|
+
"type": "tuple",
|
|
256
|
+
"internalType": "struct IHasSwapPath.PayoutSwapPath",
|
|
257
|
+
"components": [
|
|
258
|
+
{
|
|
259
|
+
"name": "path",
|
|
260
|
+
"type": "tuple[]",
|
|
261
|
+
"internalType": "struct PathKey[]",
|
|
262
|
+
"components": [
|
|
263
|
+
{
|
|
264
|
+
"name": "intermediateCurrency",
|
|
265
|
+
"type": "address",
|
|
266
|
+
"internalType": "Currency"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "fee",
|
|
270
|
+
"type": "uint24",
|
|
271
|
+
"internalType": "uint24"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"name": "tickSpacing",
|
|
275
|
+
"type": "int24",
|
|
276
|
+
"internalType": "int24"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "hooks",
|
|
280
|
+
"type": "address",
|
|
281
|
+
"internalType": "contract IHooks"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "hookData",
|
|
285
|
+
"type": "bytes",
|
|
286
|
+
"internalType": "bytes"
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "currencyIn",
|
|
292
|
+
"type": "address",
|
|
293
|
+
"internalType": "Currency"
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"stateMutability": "view"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"type": "function",
|
|
302
|
+
"name": "getPoolConfiguration",
|
|
303
|
+
"inputs": [],
|
|
304
|
+
"outputs": [
|
|
305
|
+
{
|
|
306
|
+
"name": "",
|
|
307
|
+
"type": "tuple",
|
|
308
|
+
"internalType": "struct PoolConfiguration",
|
|
309
|
+
"components": [
|
|
310
|
+
{
|
|
311
|
+
"name": "version",
|
|
312
|
+
"type": "uint8",
|
|
313
|
+
"internalType": "uint8"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "numPositions",
|
|
317
|
+
"type": "uint16",
|
|
318
|
+
"internalType": "uint16"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "fee",
|
|
322
|
+
"type": "uint24",
|
|
323
|
+
"internalType": "uint24"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"name": "tickSpacing",
|
|
327
|
+
"type": "int24",
|
|
328
|
+
"internalType": "int24"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "numDiscoveryPositions",
|
|
332
|
+
"type": "uint16[]",
|
|
333
|
+
"internalType": "uint16[]"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "tickLower",
|
|
337
|
+
"type": "int24[]",
|
|
338
|
+
"internalType": "int24[]"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "tickUpper",
|
|
342
|
+
"type": "int24[]",
|
|
343
|
+
"internalType": "int24[]"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"name": "maxDiscoverySupplyShare",
|
|
347
|
+
"type": "uint256[]",
|
|
348
|
+
"internalType": "uint256[]"
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
"stateMutability": "view"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"type": "function",
|
|
357
|
+
"name": "getPoolKey",
|
|
358
|
+
"inputs": [],
|
|
359
|
+
"outputs": [
|
|
360
|
+
{
|
|
361
|
+
"name": "",
|
|
362
|
+
"type": "tuple",
|
|
363
|
+
"internalType": "struct PoolKey",
|
|
364
|
+
"components": [
|
|
365
|
+
{
|
|
366
|
+
"name": "currency0",
|
|
367
|
+
"type": "address",
|
|
368
|
+
"internalType": "Currency"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"name": "currency1",
|
|
372
|
+
"type": "address",
|
|
373
|
+
"internalType": "Currency"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "fee",
|
|
377
|
+
"type": "uint24",
|
|
378
|
+
"internalType": "uint24"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"name": "tickSpacing",
|
|
382
|
+
"type": "int24",
|
|
383
|
+
"internalType": "int24"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "hooks",
|
|
387
|
+
"type": "address",
|
|
388
|
+
"internalType": "contract IHooks"
|
|
389
|
+
}
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
],
|
|
393
|
+
"stateMutability": "view"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"type": "function",
|
|
397
|
+
"name": "hooks",
|
|
398
|
+
"inputs": [],
|
|
399
|
+
"outputs": [
|
|
400
|
+
{
|
|
401
|
+
"name": "",
|
|
402
|
+
"type": "address",
|
|
403
|
+
"internalType": "contract IHooks"
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"stateMutability": "view"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"type": "function",
|
|
410
|
+
"name": "initialize",
|
|
411
|
+
"inputs": [
|
|
412
|
+
{
|
|
413
|
+
"name": "payoutRecipient_",
|
|
414
|
+
"type": "address",
|
|
415
|
+
"internalType": "address"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "owners_",
|
|
419
|
+
"type": "address[]",
|
|
420
|
+
"internalType": "address[]"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "tokenURI_",
|
|
424
|
+
"type": "string",
|
|
425
|
+
"internalType": "string"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"name": "name_",
|
|
429
|
+
"type": "string",
|
|
430
|
+
"internalType": "string"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"name": "symbol_",
|
|
434
|
+
"type": "string",
|
|
435
|
+
"internalType": "string"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"name": "platformReferrer_",
|
|
439
|
+
"type": "address",
|
|
440
|
+
"internalType": "address"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"name": "currency_",
|
|
444
|
+
"type": "address",
|
|
445
|
+
"internalType": "address"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"name": "poolKey_",
|
|
449
|
+
"type": "tuple",
|
|
450
|
+
"internalType": "struct PoolKey",
|
|
451
|
+
"components": [
|
|
452
|
+
{
|
|
453
|
+
"name": "currency0",
|
|
454
|
+
"type": "address",
|
|
455
|
+
"internalType": "Currency"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "currency1",
|
|
459
|
+
"type": "address",
|
|
460
|
+
"internalType": "Currency"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"name": "fee",
|
|
464
|
+
"type": "uint24",
|
|
465
|
+
"internalType": "uint24"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "tickSpacing",
|
|
469
|
+
"type": "int24",
|
|
470
|
+
"internalType": "int24"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "hooks",
|
|
474
|
+
"type": "address",
|
|
475
|
+
"internalType": "contract IHooks"
|
|
476
|
+
}
|
|
477
|
+
]
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"name": "sqrtPriceX96",
|
|
481
|
+
"type": "uint160",
|
|
482
|
+
"internalType": "uint160"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"name": "poolConfiguration_",
|
|
486
|
+
"type": "tuple",
|
|
487
|
+
"internalType": "struct PoolConfiguration",
|
|
488
|
+
"components": [
|
|
489
|
+
{
|
|
490
|
+
"name": "version",
|
|
491
|
+
"type": "uint8",
|
|
492
|
+
"internalType": "uint8"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"name": "numPositions",
|
|
496
|
+
"type": "uint16",
|
|
497
|
+
"internalType": "uint16"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "fee",
|
|
501
|
+
"type": "uint24",
|
|
502
|
+
"internalType": "uint24"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"name": "tickSpacing",
|
|
506
|
+
"type": "int24",
|
|
507
|
+
"internalType": "int24"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"name": "numDiscoveryPositions",
|
|
511
|
+
"type": "uint16[]",
|
|
512
|
+
"internalType": "uint16[]"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"name": "tickLower",
|
|
516
|
+
"type": "int24[]",
|
|
517
|
+
"internalType": "int24[]"
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"name": "tickUpper",
|
|
521
|
+
"type": "int24[]",
|
|
522
|
+
"internalType": "int24[]"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"name": "maxDiscoverySupplyShare",
|
|
526
|
+
"type": "uint256[]",
|
|
527
|
+
"internalType": "uint256[]"
|
|
528
|
+
}
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
"outputs": [],
|
|
533
|
+
"stateMutability": "nonpayable"
|
|
534
|
+
},
|
|
242
535
|
{
|
|
243
536
|
"type": "function",
|
|
244
537
|
"name": "isOwner",
|
|
@@ -258,6 +551,57 @@
|
|
|
258
551
|
],
|
|
259
552
|
"stateMutability": "view"
|
|
260
553
|
},
|
|
554
|
+
{
|
|
555
|
+
"type": "function",
|
|
556
|
+
"name": "migrateLiquidity",
|
|
557
|
+
"inputs": [
|
|
558
|
+
{
|
|
559
|
+
"name": "newHook",
|
|
560
|
+
"type": "address",
|
|
561
|
+
"internalType": "address"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"name": "additionalData",
|
|
565
|
+
"type": "bytes",
|
|
566
|
+
"internalType": "bytes"
|
|
567
|
+
}
|
|
568
|
+
],
|
|
569
|
+
"outputs": [
|
|
570
|
+
{
|
|
571
|
+
"name": "newPoolKey",
|
|
572
|
+
"type": "tuple",
|
|
573
|
+
"internalType": "struct PoolKey",
|
|
574
|
+
"components": [
|
|
575
|
+
{
|
|
576
|
+
"name": "currency0",
|
|
577
|
+
"type": "address",
|
|
578
|
+
"internalType": "Currency"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"name": "currency1",
|
|
582
|
+
"type": "address",
|
|
583
|
+
"internalType": "Currency"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"name": "fee",
|
|
587
|
+
"type": "uint24",
|
|
588
|
+
"internalType": "uint24"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"name": "tickSpacing",
|
|
592
|
+
"type": "int24",
|
|
593
|
+
"internalType": "int24"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"name": "hooks",
|
|
597
|
+
"type": "address",
|
|
598
|
+
"internalType": "contract IHooks"
|
|
599
|
+
}
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
],
|
|
603
|
+
"stateMutability": "nonpayable"
|
|
604
|
+
},
|
|
261
605
|
{
|
|
262
606
|
"type": "function",
|
|
263
607
|
"name": "name",
|
|
@@ -372,6 +716,19 @@
|
|
|
372
716
|
],
|
|
373
717
|
"stateMutability": "view"
|
|
374
718
|
},
|
|
719
|
+
{
|
|
720
|
+
"type": "function",
|
|
721
|
+
"name": "poolManager",
|
|
722
|
+
"inputs": [],
|
|
723
|
+
"outputs": [
|
|
724
|
+
{
|
|
725
|
+
"name": "",
|
|
726
|
+
"type": "address",
|
|
727
|
+
"internalType": "contract IPoolManager"
|
|
728
|
+
}
|
|
729
|
+
],
|
|
730
|
+
"stateMutability": "view"
|
|
731
|
+
},
|
|
375
732
|
{
|
|
376
733
|
"type": "function",
|
|
377
734
|
"name": "protocolRewardRecipient",
|
|
@@ -961,6 +1318,91 @@
|
|
|
961
1318
|
],
|
|
962
1319
|
"anonymous": false
|
|
963
1320
|
},
|
|
1321
|
+
{
|
|
1322
|
+
"type": "event",
|
|
1323
|
+
"name": "LiquidityMigrated",
|
|
1324
|
+
"inputs": [
|
|
1325
|
+
{
|
|
1326
|
+
"name": "fromPoolKey",
|
|
1327
|
+
"type": "tuple",
|
|
1328
|
+
"indexed": false,
|
|
1329
|
+
"internalType": "struct PoolKey",
|
|
1330
|
+
"components": [
|
|
1331
|
+
{
|
|
1332
|
+
"name": "currency0",
|
|
1333
|
+
"type": "address",
|
|
1334
|
+
"internalType": "Currency"
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
"name": "currency1",
|
|
1338
|
+
"type": "address",
|
|
1339
|
+
"internalType": "Currency"
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
"name": "fee",
|
|
1343
|
+
"type": "uint24",
|
|
1344
|
+
"internalType": "uint24"
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"name": "tickSpacing",
|
|
1348
|
+
"type": "int24",
|
|
1349
|
+
"internalType": "int24"
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
"name": "hooks",
|
|
1353
|
+
"type": "address",
|
|
1354
|
+
"internalType": "contract IHooks"
|
|
1355
|
+
}
|
|
1356
|
+
]
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
"name": "fromPoolKeyHash",
|
|
1360
|
+
"type": "bytes32",
|
|
1361
|
+
"indexed": false,
|
|
1362
|
+
"internalType": "bytes32"
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
"name": "toPoolKey",
|
|
1366
|
+
"type": "tuple",
|
|
1367
|
+
"indexed": false,
|
|
1368
|
+
"internalType": "struct PoolKey",
|
|
1369
|
+
"components": [
|
|
1370
|
+
{
|
|
1371
|
+
"name": "currency0",
|
|
1372
|
+
"type": "address",
|
|
1373
|
+
"internalType": "Currency"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
"name": "currency1",
|
|
1377
|
+
"type": "address",
|
|
1378
|
+
"internalType": "Currency"
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
"name": "fee",
|
|
1382
|
+
"type": "uint24",
|
|
1383
|
+
"internalType": "uint24"
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
"name": "tickSpacing",
|
|
1387
|
+
"type": "int24",
|
|
1388
|
+
"internalType": "int24"
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
"name": "hooks",
|
|
1392
|
+
"type": "address",
|
|
1393
|
+
"internalType": "contract IHooks"
|
|
1394
|
+
}
|
|
1395
|
+
]
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
"name": "toPoolKeyHash",
|
|
1399
|
+
"type": "bytes32",
|
|
1400
|
+
"indexed": false,
|
|
1401
|
+
"internalType": "bytes32"
|
|
1402
|
+
}
|
|
1403
|
+
],
|
|
1404
|
+
"anonymous": false
|
|
1405
|
+
},
|
|
964
1406
|
{
|
|
965
1407
|
"type": "event",
|
|
966
1408
|
"name": "NameAndSymbolUpdated",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"type": "receive",
|
|
4
|
+
"stateMutability": "payable"
|
|
5
|
+
},
|
|
2
6
|
{
|
|
3
7
|
"type": "function",
|
|
4
8
|
"name": "afterAddLiquidity",
|
|
@@ -965,8 +969,8 @@
|
|
|
965
969
|
"inputs": [
|
|
966
970
|
{
|
|
967
971
|
"name": "poolKeyHash",
|
|
968
|
-
"type": "
|
|
969
|
-
"internalType": "
|
|
972
|
+
"type": "bytes32",
|
|
973
|
+
"internalType": "bytes32"
|
|
970
974
|
}
|
|
971
975
|
],
|
|
972
976
|
"outputs": [
|