@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.
Files changed (78) hide show
  1. package/.turbo/turbo-build.log +107 -110
  2. package/CHANGELOG.md +50 -0
  3. package/README.md +48 -1
  4. package/abis/BaseCoin.json +442 -0
  5. package/abis/BaseZoraV4CoinHook.json +6 -2
  6. package/abis/CoinTest.json +3 -246
  7. package/abis/CoinUniV4Test.json +20 -0
  8. package/abis/ContentCoinHook.json +6 -2
  9. package/abis/CreatorCoinHook.json +6 -2
  10. package/abis/FactoryTest.json +8 -133
  11. package/abis/FeeEstimatorHook.json +6 -2
  12. package/abis/HooksTest.json +0 -26
  13. package/abis/ICoin.json +378 -0
  14. package/abis/ICoinV3.json +378 -0
  15. package/abis/IZoraFactory.json +0 -18
  16. package/abis/IZoraV4CoinHook.json +2 -2
  17. package/abis/LiquidityMigrationTest.json +101 -0
  18. package/abis/MockBadFactory.json +15 -0
  19. package/abis/Ownable2StepUpgradeable.json +138 -0
  20. package/abis/ZoraFactoryImpl.json +38 -65
  21. package/addresses/8453.json +5 -5
  22. package/dist/index.cjs +272 -268
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.js +270 -266
  25. package/dist/index.js.map +1 -1
  26. package/dist/wagmiGenerated.d.ts +397 -470
  27. package/dist/wagmiGenerated.d.ts.map +1 -1
  28. package/package/wagmiGenerated.ts +275 -271
  29. package/package.json +3 -3
  30. package/script/DeployPostDeploymentHooks.s.sol +2 -2
  31. package/script/TestBackingCoinSwap.s.sol +9 -9
  32. package/script/TestV4Swap.s.sol +9 -9
  33. package/script/UpgradeFactoryImpl.s.sol +0 -1
  34. package/src/BaseCoin.sol +109 -6
  35. package/src/ContentCoin.sol +45 -0
  36. package/src/CreatorCoin.sol +7 -5
  37. package/src/ZoraFactoryImpl.sol +12 -95
  38. package/src/deployment/CoinsDeployerBase.sol +13 -30
  39. package/src/hooks/BaseZoraV4CoinHook.sol +8 -6
  40. package/src/hooks/deployment/BuySupplyWithSwapRouterHook.sol +4 -5
  41. package/src/interfaces/ICoin.sol +67 -1
  42. package/src/interfaces/ICreatorCoin.sol +2 -2
  43. package/src/interfaces/IZoraFactory.sol +0 -5
  44. package/src/interfaces/IZoraV4CoinHook.sol +1 -1
  45. package/src/libs/CoinConfigurationVersions.sol +1 -39
  46. package/src/libs/CoinRewardsV4.sol +2 -2
  47. package/src/libs/CoinSetup.sol +1 -4
  48. package/src/libs/UniV4SwapHelper.sol +1 -1
  49. package/src/libs/UniV4SwapToCurrency.sol +2 -2
  50. package/src/libs/V4Liquidity.sol +1 -1
  51. package/src/version/ContractVersionBase.sol +1 -1
  52. package/test/Coin.t.sol +112 -535
  53. package/test/CoinUniV4.t.sol +66 -10
  54. package/test/DeploymentHooks.t.sol +5 -102
  55. package/test/Factory.t.sol +49 -291
  56. package/test/LiquidityMigration.t.sol +160 -2
  57. package/test/MultiOwnable.t.sol +36 -36
  58. package/test/Upgrades.t.sol +23 -42
  59. package/test/utils/BaseTest.sol +39 -84
  60. package/test/utils/FeeEstimatorHook.sol +3 -3
  61. package/wagmi.config.ts +2 -2
  62. package/abis/Coin.json +0 -1912
  63. package/abis/DopplerUniswapV3Test.json +0 -800
  64. package/abis/ICoinV4.json +0 -1048
  65. package/abis/Simulate.json +0 -29
  66. package/abis/UniV3BuySell.json +0 -12
  67. package/abis/UniV3Errors.json +0 -32
  68. package/script/Simulate.s.sol +0 -59
  69. package/src/Coin.sol +0 -236
  70. package/src/CoinV4.sol +0 -151
  71. package/src/interfaces/ICoinV4.sol +0 -74
  72. package/src/libs/CoinDopplerUniV3.sol +0 -50
  73. package/src/libs/CoinRewards.sol +0 -201
  74. package/src/libs/CoinSetupV3.sol +0 -50
  75. package/src/libs/UniV3BuySell.sol +0 -231
  76. package/src/libs/UniV3Errors.sol +0 -11
  77. package/test/CoinDopplerUniV3.t.sol +0 -310
  78. /package/abis/{CoinV4.json → ContentCoin.json} +0 -0
@@ -249,75 +249,14 @@
249
249
  },
250
250
  {
251
251
  "type": "function",
252
- "name": "test_burn",
253
- "inputs": [],
254
- "outputs": [],
255
- "stateMutability": "nonpayable"
256
- },
257
- {
258
- "type": "function",
259
- "name": "test_buy_validate_return_amounts",
260
- "inputs": [
261
- {
262
- "name": "orderSize",
263
- "type": "uint256",
264
- "internalType": "uint256"
265
- }
266
- ],
267
- "outputs": [],
268
- "stateMutability": "nonpayable"
269
- },
270
- {
271
- "type": "function",
272
- "name": "test_buy_with_eth",
273
- "inputs": [],
274
- "outputs": [],
275
- "stateMutability": "nonpayable"
276
- },
277
- {
278
- "type": "function",
279
- "name": "test_buy_with_eth_fuzz",
280
- "inputs": [
281
- {
282
- "name": "ethOrderSize",
283
- "type": "uint256",
284
- "internalType": "uint256"
285
- }
286
- ],
287
- "outputs": [],
288
- "stateMutability": "nonpayable"
289
- },
290
- {
291
- "type": "function",
292
- "name": "test_buy_with_eth_too_small",
293
- "inputs": [],
294
- "outputs": [],
295
- "stateMutability": "nonpayable"
296
- },
297
- {
298
- "type": "function",
299
- "name": "test_buy_with_minimum_eth",
300
- "inputs": [],
301
- "outputs": [],
302
- "stateMutability": "nonpayable"
303
- },
304
- {
305
- "type": "function",
306
- "name": "test_buy_with_usdc",
307
- "inputs": [],
308
- "outputs": [],
309
- "stateMutability": "nonpayable"
310
- },
311
- {
312
- "type": "function",
313
- "name": "test_buy_with_usdc_revert_no_approval",
252
+ "name": "test_access_control_unauthorized_actions",
314
253
  "inputs": [],
315
254
  "outputs": [],
316
255
  "stateMutability": "nonpayable"
317
256
  },
318
257
  {
319
258
  "type": "function",
320
- "name": "test_constructor_validation",
259
+ "name": "test_burn",
321
260
  "inputs": [],
322
261
  "outputs": [],
323
262
  "stateMutability": "nonpayable"
@@ -345,14 +284,7 @@
345
284
  },
346
285
  {
347
286
  "type": "function",
348
- "name": "test_default_order_referrer",
349
- "inputs": [],
350
- "outputs": [],
351
- "stateMutability": "nonpayable"
352
- },
353
- {
354
- "type": "function",
355
- "name": "test_default_platform_referrer",
287
+ "name": "test_deploy_coin_with_invalid_parameters",
356
288
  "inputs": [],
357
289
  "outputs": [],
358
290
  "stateMutability": "nonpayable"
@@ -364,13 +296,6 @@
364
296
  "outputs": [],
365
297
  "stateMutability": "nonpayable"
366
298
  },
367
- {
368
- "type": "function",
369
- "name": "test_eth_transfer_fail",
370
- "inputs": [],
371
- "outputs": [],
372
- "stateMutability": "nonpayable"
373
- },
374
299
  {
375
300
  "type": "function",
376
301
  "name": "test_initialize_validation",
@@ -392,62 +317,6 @@
392
317
  "outputs": [],
393
318
  "stateMutability": "nonpayable"
394
319
  },
395
- {
396
- "type": "function",
397
- "name": "test_market_slippage",
398
- "inputs": [],
399
- "outputs": [],
400
- "stateMutability": "nonpayable"
401
- },
402
- {
403
- "type": "function",
404
- "name": "test_receive_from_weth",
405
- "inputs": [],
406
- "outputs": [],
407
- "stateMutability": "nonpayable"
408
- },
409
- {
410
- "type": "function",
411
- "name": "test_revert_buy_zero_address_recipient",
412
- "inputs": [],
413
- "outputs": [],
414
- "stateMutability": "nonpayable"
415
- },
416
- {
417
- "type": "function",
418
- "name": "test_revert_buy_zero_address_recipient_legacy",
419
- "inputs": [],
420
- "outputs": [],
421
- "stateMutability": "nonpayable"
422
- },
423
- {
424
- "type": "function",
425
- "name": "test_revert_receive_from_weth_wrong_sender",
426
- "inputs": [],
427
- "outputs": [],
428
- "stateMutability": "nonpayable"
429
- },
430
- {
431
- "type": "function",
432
- "name": "test_revert_receive_only_weth",
433
- "inputs": [],
434
- "outputs": [],
435
- "stateMutability": "nonpayable"
436
- },
437
- {
438
- "type": "function",
439
- "name": "test_revert_sell_insufficient_liquidity",
440
- "inputs": [],
441
- "outputs": [],
442
- "stateMutability": "nonpayable"
443
- },
444
- {
445
- "type": "function",
446
- "name": "test_revert_sell_zero_address_recipient",
447
- "inputs": [],
448
- "outputs": [],
449
- "stateMutability": "nonpayable"
450
- },
451
320
  {
452
321
  "type": "function",
453
322
  "name": "test_revert_set_payout_recipient_address_zero",
@@ -462,61 +331,6 @@
462
331
  "outputs": [],
463
332
  "stateMutability": "nonpayable"
464
333
  },
465
- {
466
- "type": "function",
467
- "name": "test_rewards",
468
- "inputs": [],
469
- "outputs": [],
470
- "stateMutability": "nonpayable"
471
- },
472
- {
473
- "type": "function",
474
- "name": "test_sell_for_eth",
475
- "inputs": [],
476
- "outputs": [],
477
- "stateMutability": "nonpayable"
478
- },
479
- {
480
- "type": "function",
481
- "name": "test_sell_for_eth_direct_and_claim_secondary",
482
- "inputs": [],
483
- "outputs": [],
484
- "stateMutability": "nonpayable"
485
- },
486
- {
487
- "type": "function",
488
- "name": "test_sell_for_eth_direct_and_claim_secondary_push_eth",
489
- "inputs": [],
490
- "outputs": [],
491
- "stateMutability": "nonpayable"
492
- },
493
- {
494
- "type": "function",
495
- "name": "test_sell_for_eth_fuzz",
496
- "inputs": [
497
- {
498
- "name": "ethOrderSize",
499
- "type": "uint256",
500
- "internalType": "uint256"
501
- }
502
- ],
503
- "outputs": [],
504
- "stateMutability": "nonpayable"
505
- },
506
- {
507
- "type": "function",
508
- "name": "test_sell_for_usdc",
509
- "inputs": [],
510
- "outputs": [],
511
- "stateMutability": "nonpayable"
512
- },
513
- {
514
- "type": "function",
515
- "name": "test_sell_partial_execution",
516
- "inputs": [],
517
- "outputs": [],
518
- "stateMutability": "nonpayable"
519
- },
520
334
  {
521
335
  "type": "function",
522
336
  "name": "test_set_contract_uri",
@@ -545,13 +359,6 @@
545
359
  "outputs": [],
546
360
  "stateMutability": "nonpayable"
547
361
  },
548
- {
549
- "type": "function",
550
- "name": "test_uniswap_v3_mint_callback_wrong_sender",
551
- "inputs": [],
552
- "outputs": [],
553
- "stateMutability": "nonpayable"
554
- },
555
362
  {
556
363
  "type": "function",
557
364
  "name": "test_update_metadata",
@@ -598,56 +405,6 @@
598
405
  ],
599
406
  "anonymous": false
600
407
  },
601
- {
602
- "type": "event",
603
- "name": "SlotFound",
604
- "inputs": [
605
- {
606
- "name": "who",
607
- "type": "address",
608
- "indexed": false,
609
- "internalType": "address"
610
- },
611
- {
612
- "name": "fsig",
613
- "type": "bytes4",
614
- "indexed": false,
615
- "internalType": "bytes4"
616
- },
617
- {
618
- "name": "keysHash",
619
- "type": "bytes32",
620
- "indexed": false,
621
- "internalType": "bytes32"
622
- },
623
- {
624
- "name": "slot",
625
- "type": "uint256",
626
- "indexed": false,
627
- "internalType": "uint256"
628
- }
629
- ],
630
- "anonymous": false
631
- },
632
- {
633
- "type": "event",
634
- "name": "WARNING_UninitedSlot",
635
- "inputs": [
636
- {
637
- "name": "who",
638
- "type": "address",
639
- "indexed": false,
640
- "internalType": "address"
641
- },
642
- {
643
- "name": "slot",
644
- "type": "uint256",
645
- "indexed": false,
646
- "internalType": "uint256"
647
- }
648
- ],
649
- "anonymous": false
650
- },
651
408
  {
652
409
  "type": "event",
653
410
  "name": "log",
@@ -393,6 +393,19 @@
393
393
  "outputs": [],
394
394
  "stateMutability": "nonpayable"
395
395
  },
396
+ {
397
+ "type": "function",
398
+ "name": "test_canSwapEthForCoin",
399
+ "inputs": [
400
+ {
401
+ "name": "amountIn",
402
+ "type": "uint128",
403
+ "internalType": "uint128"
404
+ }
405
+ ],
406
+ "outputs": [],
407
+ "stateMutability": "nonpayable"
408
+ },
396
409
  {
397
410
  "type": "function",
398
411
  "name": "test_distributesMarketRewards",
@@ -416,6 +429,13 @@
416
429
  "outputs": [],
417
430
  "stateMutability": "nonpayable"
418
431
  },
432
+ {
433
+ "type": "function",
434
+ "name": "test_distributesMarketRewardsInEth",
435
+ "inputs": [],
436
+ "outputs": [],
437
+ "stateMutability": "nonpayable"
438
+ },
419
439
  {
420
440
  "type": "function",
421
441
  "name": "test_estimateLpFees",
@@ -25,6 +25,10 @@
25
25
  ],
26
26
  "stateMutability": "nonpayable"
27
27
  },
28
+ {
29
+ "type": "receive",
30
+ "stateMutability": "payable"
31
+ },
28
32
  {
29
33
  "type": "function",
30
34
  "name": "afterAddLiquidity",
@@ -991,8 +995,8 @@
991
995
  "inputs": [
992
996
  {
993
997
  "name": "poolKeyHash",
994
- "type": "bytes23",
995
- "internalType": "bytes23"
998
+ "type": "bytes32",
999
+ "internalType": "bytes32"
996
1000
  }
997
1001
  ],
998
1002
  "outputs": [
@@ -25,6 +25,10 @@
25
25
  ],
26
26
  "stateMutability": "nonpayable"
27
27
  },
28
+ {
29
+ "type": "receive",
30
+ "stateMutability": "payable"
31
+ },
28
32
  {
29
33
  "type": "function",
30
34
  "name": "afterAddLiquidity",
@@ -991,8 +995,8 @@
991
995
  "inputs": [
992
996
  {
993
997
  "name": "poolKeyHash",
994
- "type": "bytes23",
995
- "internalType": "bytes23"
998
+ "type": "bytes32",
999
+ "internalType": "bytes32"
996
1000
  }
997
1001
  ],
998
1002
  "outputs": [
@@ -287,178 +287,53 @@
287
287
  },
288
288
  {
289
289
  "type": "function",
290
- "name": "test_deploy_no_eth",
291
- "inputs": [],
292
- "outputs": [],
293
- "stateMutability": "nonpayable"
294
- },
295
- {
296
- "type": "function",
297
- "name": "test_deploy_with_eth",
298
- "inputs": [
299
- {
300
- "name": "initialOrderSize",
301
- "type": "uint256",
302
- "internalType": "uint256"
303
- }
304
- ],
305
- "outputs": [],
306
- "stateMutability": "nonpayable"
307
- },
308
- {
309
- "type": "function",
310
- "name": "test_deploy_with_one_eth",
311
- "inputs": [],
312
- "outputs": [],
313
- "stateMutability": "nonpayable"
314
- },
315
- {
316
- "type": "function",
317
- "name": "test_deploy_with_usdc",
318
- "inputs": [],
319
- "outputs": [],
320
- "stateMutability": "nonpayable"
321
- },
322
- {
323
- "type": "function",
324
- "name": "test_deploy_with_usdc_order",
325
- "inputs": [],
326
- "outputs": [],
327
- "stateMutability": "nonpayable"
328
- },
329
- {
330
- "type": "function",
331
- "name": "test_deploy_with_usdc_platform_referrer_zero",
332
- "inputs": [],
333
- "outputs": [],
334
- "stateMutability": "nonpayable"
335
- },
336
- {
337
- "type": "function",
338
- "name": "test_deploy_with_usdc_revert_invalid_eth_transfer",
339
- "inputs": [],
340
- "outputs": [],
341
- "stateMutability": "nonpayable"
342
- },
343
- {
344
- "type": "function",
345
- "name": "test_deploy_with_usdc_revert_one_owner_required",
290
+ "name": "test_factory_constructor_and_proxy_setup",
346
291
  "inputs": [],
347
292
  "outputs": [],
348
293
  "stateMutability": "nonpayable"
349
294
  },
350
295
  {
351
296
  "type": "function",
352
- "name": "test_deploy_with_usdc_revert_payout_recipient_zero",
297
+ "name": "test_implementation_address",
353
298
  "inputs": [],
354
299
  "outputs": [],
355
- "stateMutability": "nonpayable"
356
- },
357
- {
358
- "type": "function",
359
- "name": "test_deploy_with_weth",
360
- "inputs": [
361
- {
362
- "name": "initialOrderSize",
363
- "type": "uint256",
364
- "internalType": "uint256"
365
- }
366
- ],
367
- "outputs": [],
368
- "stateMutability": "nonpayable"
300
+ "stateMutability": "view"
369
301
  },
370
302
  {
371
303
  "type": "function",
372
- "name": "test_deploy_without_initial_order",
304
+ "name": "test_ownable2Step",
373
305
  "inputs": [],
374
306
  "outputs": [],
375
307
  "stateMutability": "nonpayable"
376
308
  },
377
309
  {
378
310
  "type": "function",
379
- "name": "test_factory_constructor_and_proxy_setup",
311
+ "name": "test_revert_invalid_owner",
380
312
  "inputs": [],
381
313
  "outputs": [],
382
314
  "stateMutability": "nonpayable"
383
315
  },
384
316
  {
385
317
  "type": "function",
386
- "name": "test_implementation_address",
387
- "inputs": [],
388
- "outputs": [],
389
- "stateMutability": "view"
390
- },
391
- {
392
- "type": "function",
393
- "name": "test_revert_invalid_owner",
318
+ "name": "test_revert_invalid_upgrade_impl",
394
319
  "inputs": [],
395
320
  "outputs": [],
396
321
  "stateMutability": "nonpayable"
397
322
  },
398
323
  {
399
324
  "type": "function",
400
- "name": "test_revert_invalid_upgrade_impl",
325
+ "name": "test_upgrade",
401
326
  "inputs": [],
402
327
  "outputs": [],
403
328
  "stateMutability": "nonpayable"
404
329
  },
405
330
  {
406
331
  "type": "function",
407
- "name": "test_upgrade",
332
+ "name": "test_upgrade_with_mismatched_contract_name",
408
333
  "inputs": [],
409
334
  "outputs": [],
410
335
  "stateMutability": "nonpayable"
411
336
  },
412
- {
413
- "type": "event",
414
- "name": "SlotFound",
415
- "inputs": [
416
- {
417
- "name": "who",
418
- "type": "address",
419
- "indexed": false,
420
- "internalType": "address"
421
- },
422
- {
423
- "name": "fsig",
424
- "type": "bytes4",
425
- "indexed": false,
426
- "internalType": "bytes4"
427
- },
428
- {
429
- "name": "keysHash",
430
- "type": "bytes32",
431
- "indexed": false,
432
- "internalType": "bytes32"
433
- },
434
- {
435
- "name": "slot",
436
- "type": "uint256",
437
- "indexed": false,
438
- "internalType": "uint256"
439
- }
440
- ],
441
- "anonymous": false
442
- },
443
- {
444
- "type": "event",
445
- "name": "WARNING_UninitedSlot",
446
- "inputs": [
447
- {
448
- "name": "who",
449
- "type": "address",
450
- "indexed": false,
451
- "internalType": "address"
452
- },
453
- {
454
- "name": "slot",
455
- "type": "uint256",
456
- "indexed": false,
457
- "internalType": "uint256"
458
- }
459
- ],
460
- "anonymous": false
461
- },
462
337
  {
463
338
  "type": "event",
464
339
  "name": "log",
@@ -25,6 +25,10 @@
25
25
  ],
26
26
  "stateMutability": "nonpayable"
27
27
  },
28
+ {
29
+ "type": "receive",
30
+ "stateMutability": "payable"
31
+ },
28
32
  {
29
33
  "type": "function",
30
34
  "name": "afterAddLiquidity",
@@ -1128,8 +1132,8 @@
1128
1132
  "inputs": [
1129
1133
  {
1130
1134
  "name": "poolKeyHash",
1131
- "type": "bytes23",
1132
- "internalType": "bytes23"
1135
+ "type": "bytes32",
1136
+ "internalType": "bytes32"
1133
1137
  }
1134
1138
  ],
1135
1139
  "outputs": [
@@ -261,32 +261,6 @@
261
261
  "outputs": [],
262
262
  "stateMutability": "nonpayable"
263
263
  },
264
- {
265
- "type": "function",
266
- "name": "test_buySupplyWithEthUsingV3Hook_withExactInputMultiHop",
267
- "inputs": [
268
- {
269
- "name": "initialOrderSize",
270
- "type": "uint256",
271
- "internalType": "uint256"
272
- }
273
- ],
274
- "outputs": [],
275
- "stateMutability": "nonpayable"
276
- },
277
- {
278
- "type": "function",
279
- "name": "test_buySupplyWithEthUsingV3Hook_withExactInputSingle",
280
- "inputs": [
281
- {
282
- "name": "initialOrderSize",
283
- "type": "uint256",
284
- "internalType": "uint256"
285
- }
286
- ],
287
- "outputs": [],
288
- "stateMutability": "nonpayable"
289
- },
290
264
  {
291
265
  "type": "function",
292
266
  "name": "test_buySupplyWithEthUsingV4Hook_withExactInputMultiHop",