@zoralabs/coins 2.0.0 → 2.1.1

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 (72) hide show
  1. package/.turbo/turbo-build.log +107 -114
  2. package/CHANGELOG.md +34 -0
  3. package/README.md +30 -109
  4. package/abis/BaseCoin.json +442 -0
  5. package/abis/CoinTest.json +3 -246
  6. package/abis/FactoryTest.json +5 -137
  7. package/abis/HooksTest.json +0 -26
  8. package/abis/ICoin.json +378 -0
  9. package/abis/ICoinV3.json +378 -0
  10. package/abis/IZoraFactory.json +0 -18
  11. package/abis/LiquidityMigrationTest.json +101 -0
  12. package/abis/MockBadFactory.json +15 -0
  13. package/abis/ZoraFactoryImpl.json +1 -67
  14. package/dist/index.cjs +236 -265
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.js +235 -264
  17. package/dist/index.js.map +1 -1
  18. package/dist/wagmiGenerated.d.ts +389 -493
  19. package/dist/wagmiGenerated.d.ts.map +1 -1
  20. package/foundry.toml +1 -3
  21. package/package/wagmiGenerated.ts +240 -269
  22. package/package.json +3 -3
  23. package/script/DeployPostDeploymentHooks.s.sol +2 -2
  24. package/script/TestBackingCoinSwap.s.sol +8 -8
  25. package/script/TestV4Swap.s.sol +8 -8
  26. package/script/UpgradeFactoryImpl.s.sol +0 -1
  27. package/src/BaseCoin.sol +111 -7
  28. package/src/ContentCoin.sol +4 -4
  29. package/src/CreatorCoin.sol +5 -5
  30. package/src/ZoraFactoryImpl.sol +10 -93
  31. package/src/deployment/CoinsDeployerBase.sol +10 -27
  32. package/src/hooks/BaseZoraV4CoinHook.sol +5 -5
  33. package/src/hooks/ContentCoinHook.sol +2 -2
  34. package/src/hooks/deployment/BuySupplyWithSwapRouterHook.sol +4 -5
  35. package/src/interfaces/ICoin.sol +67 -1
  36. package/src/interfaces/ICreatorCoin.sol +2 -2
  37. package/src/interfaces/IZoraFactory.sol +0 -5
  38. package/src/libs/CoinConfigurationVersions.sol +1 -39
  39. package/src/libs/CoinRewardsV4.sol +2 -2
  40. package/src/libs/CoinSetup.sol +1 -4
  41. package/src/libs/MarketConstants.sol +0 -4
  42. package/src/libs/UniV4SwapHelper.sol +1 -1
  43. package/src/libs/UniV4SwapToCurrency.sol +2 -2
  44. package/src/libs/V4Liquidity.sol +1 -1
  45. package/src/version/ContractVersionBase.sol +1 -1
  46. package/test/Coin.t.sol +112 -535
  47. package/test/CoinUniV4.t.sol +7 -7
  48. package/test/DeploymentHooks.t.sol +5 -102
  49. package/test/Factory.t.sol +23 -306
  50. package/test/LiquidityMigration.t.sol +160 -2
  51. package/test/MultiOwnable.t.sol +36 -36
  52. package/test/Upgrades.t.sol +16 -35
  53. package/test/utils/BaseTest.sol +16 -69
  54. package/test/utils/FeeEstimatorHook.sol +3 -3
  55. package/wagmi.config.ts +1 -1
  56. package/abis/BaseCoinV4.json +0 -1840
  57. package/abis/Coin.json +0 -1912
  58. package/abis/DopplerUniswapV3Test.json +0 -800
  59. package/abis/ICoinV4.json +0 -1048
  60. package/abis/Simulate.json +0 -29
  61. package/abis/UniV3BuySell.json +0 -12
  62. package/abis/UniV3Errors.json +0 -32
  63. package/script/Simulate.s.sol +0 -59
  64. package/src/BaseCoinV4.sol +0 -143
  65. package/src/Coin.sol +0 -236
  66. package/src/interfaces/ICoinV4.sol +0 -74
  67. package/src/libs/CoinDopplerUniV3.sol +0 -50
  68. package/src/libs/CoinRewards.sol +0 -201
  69. package/src/libs/CoinSetupV3.sol +0 -50
  70. package/src/libs/UniV3BuySell.sol +0 -231
  71. package/src/libs/UniV3Errors.sol +0 -11
  72. package/test/CoinDopplerUniV3.t.sol +0 -310
@@ -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",
@@ -285,95 +285,6 @@
285
285
  "outputs": [],
286
286
  "stateMutability": "nonpayable"
287
287
  },
288
- {
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",
346
- "inputs": [],
347
- "outputs": [],
348
- "stateMutability": "nonpayable"
349
- },
350
- {
351
- "type": "function",
352
- "name": "test_deploy_with_usdc_revert_payout_recipient_zero",
353
- "inputs": [],
354
- "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"
369
- },
370
- {
371
- "type": "function",
372
- "name": "test_deploy_without_initial_order",
373
- "inputs": [],
374
- "outputs": [],
375
- "stateMutability": "nonpayable"
376
- },
377
288
  {
378
289
  "type": "function",
379
290
  "name": "test_factory_constructor_and_proxy_setup",
@@ -417,54 +328,11 @@
417
328
  "stateMutability": "nonpayable"
418
329
  },
419
330
  {
420
- "type": "event",
421
- "name": "SlotFound",
422
- "inputs": [
423
- {
424
- "name": "who",
425
- "type": "address",
426
- "indexed": false,
427
- "internalType": "address"
428
- },
429
- {
430
- "name": "fsig",
431
- "type": "bytes4",
432
- "indexed": false,
433
- "internalType": "bytes4"
434
- },
435
- {
436
- "name": "keysHash",
437
- "type": "bytes32",
438
- "indexed": false,
439
- "internalType": "bytes32"
440
- },
441
- {
442
- "name": "slot",
443
- "type": "uint256",
444
- "indexed": false,
445
- "internalType": "uint256"
446
- }
447
- ],
448
- "anonymous": false
449
- },
450
- {
451
- "type": "event",
452
- "name": "WARNING_UninitedSlot",
453
- "inputs": [
454
- {
455
- "name": "who",
456
- "type": "address",
457
- "indexed": false,
458
- "internalType": "address"
459
- },
460
- {
461
- "name": "slot",
462
- "type": "uint256",
463
- "indexed": false,
464
- "internalType": "uint256"
465
- }
466
- ],
467
- "anonymous": false
331
+ "type": "function",
332
+ "name": "test_upgrade_with_mismatched_contract_name",
333
+ "inputs": [],
334
+ "outputs": [],
335
+ "stateMutability": "nonpayable"
468
336
  },
469
337
  {
470
338
  "type": "event",
@@ -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",