@zoralabs/coins 1.1.1 → 2.0.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 (61) hide show
  1. package/.turbo/turbo-build.log +97 -93
  2. package/CHANGELOG.md +28 -0
  3. package/LICENSE +90 -21
  4. package/README.md +126 -0
  5. package/abis/BaseCoinV4.json +1840 -0
  6. package/abis/BaseZoraV4CoinHook.json +6 -2
  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 +7 -0
  11. package/abis/FeeEstimatorHook.json +6 -2
  12. package/abis/IZoraV4CoinHook.json +2 -2
  13. package/abis/Ownable2StepUpgradeable.json +138 -0
  14. package/abis/ZoraFactoryImpl.json +39 -0
  15. package/addresses/8453.json +5 -5
  16. package/dist/index.cjs +36 -3
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.js +35 -2
  19. package/dist/index.js.map +1 -1
  20. package/dist/wagmiGenerated.d.ts +32 -1
  21. package/dist/wagmiGenerated.d.ts.map +1 -1
  22. package/package/wagmiGenerated.ts +35 -2
  23. package/package.json +1 -1
  24. package/script/TestBackingCoinSwap.s.sol +1 -1
  25. package/script/TestV4Swap.s.sol +1 -1
  26. package/src/BaseCoin.sol +7 -2
  27. package/src/{CoinV4.sol → BaseCoinV4.sol} +15 -17
  28. package/src/Coin.sol +7 -1
  29. package/src/ContentCoin.sol +45 -0
  30. package/src/CreatorCoin.sol +14 -6
  31. package/src/ZoraFactoryImpl.sol +10 -4
  32. package/src/deployment/CoinsDeployerBase.sol +3 -3
  33. package/src/hooks/BaseZoraV4CoinHook.sol +10 -2
  34. package/src/hooks/ContentCoinHook.sol +7 -1
  35. package/src/hooks/CreatorCoinHook.sol +7 -1
  36. package/src/hooks/HookUpgradeGate.sol +7 -1
  37. package/src/interfaces/IZoraV4CoinHook.sol +1 -1
  38. package/src/libs/CoinCommon.sol +7 -1
  39. package/src/libs/CoinConfigurationVersions.sol +7 -1
  40. package/src/libs/CoinConstants.sol +7 -1
  41. package/src/libs/CoinDopplerMultiCurve.sol +7 -1
  42. package/src/libs/CoinRewards.sol +7 -1
  43. package/src/libs/CoinRewardsV4.sol +7 -1
  44. package/src/libs/CoinSetup.sol +7 -1
  45. package/src/libs/CreatorCoinConstants.sol +7 -1
  46. package/src/libs/CreatorCoinRewards.sol +7 -1
  47. package/src/libs/DopplerMath.sol +7 -1
  48. package/src/libs/HooksDeployment.sol +7 -1
  49. package/src/libs/PoolStateReader.sol +7 -1
  50. package/src/libs/UniV4SwapHelper.sol +7 -1
  51. package/src/libs/UniV4SwapToCurrency.sol +7 -1
  52. package/src/libs/V4Liquidity.sol +7 -1
  53. package/src/types/PoolConfiguration.sol +7 -1
  54. package/src/utils/AutoSwapper.sol +7 -1
  55. package/src/version/ContractVersionBase.sol +1 -1
  56. package/test/CoinUniV4.t.sol +61 -5
  57. package/test/Factory.t.sol +41 -0
  58. package/test/Upgrades.t.sol +8 -8
  59. package/test/utils/BaseTest.sol +23 -15
  60. package/wagmi.config.ts +1 -1
  61. /package/abis/{CoinV4.json → ContentCoin.json} +0 -0
@@ -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": "bytes23",
969
- "internalType": "bytes23"
972
+ "type": "bytes32",
973
+ "internalType": "bytes32"
970
974
  }
971
975
  ],
972
976
  "outputs": [
@@ -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": [
@@ -388,6 +388,13 @@
388
388
  "outputs": [],
389
389
  "stateMutability": "view"
390
390
  },
391
+ {
392
+ "type": "function",
393
+ "name": "test_ownable2Step",
394
+ "inputs": [],
395
+ "outputs": [],
396
+ "stateMutability": "nonpayable"
397
+ },
391
398
  {
392
399
  "type": "function",
393
400
  "name": "test_revert_invalid_owner",
@@ -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": [
@@ -80,8 +80,8 @@
80
80
  "inputs": [
81
81
  {
82
82
  "name": "poolKeyHash",
83
- "type": "bytes23",
84
- "internalType": "bytes23"
83
+ "type": "bytes32",
84
+ "internalType": "bytes32"
85
85
  }
86
86
  ],
87
87
  "outputs": [
@@ -0,0 +1,138 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "acceptOwnership",
5
+ "inputs": [],
6
+ "outputs": [],
7
+ "stateMutability": "nonpayable"
8
+ },
9
+ {
10
+ "type": "function",
11
+ "name": "owner",
12
+ "inputs": [],
13
+ "outputs": [
14
+ {
15
+ "name": "",
16
+ "type": "address",
17
+ "internalType": "address"
18
+ }
19
+ ],
20
+ "stateMutability": "view"
21
+ },
22
+ {
23
+ "type": "function",
24
+ "name": "pendingOwner",
25
+ "inputs": [],
26
+ "outputs": [
27
+ {
28
+ "name": "",
29
+ "type": "address",
30
+ "internalType": "address"
31
+ }
32
+ ],
33
+ "stateMutability": "view"
34
+ },
35
+ {
36
+ "type": "function",
37
+ "name": "renounceOwnership",
38
+ "inputs": [],
39
+ "outputs": [],
40
+ "stateMutability": "nonpayable"
41
+ },
42
+ {
43
+ "type": "function",
44
+ "name": "transferOwnership",
45
+ "inputs": [
46
+ {
47
+ "name": "newOwner",
48
+ "type": "address",
49
+ "internalType": "address"
50
+ }
51
+ ],
52
+ "outputs": [],
53
+ "stateMutability": "nonpayable"
54
+ },
55
+ {
56
+ "type": "event",
57
+ "name": "Initialized",
58
+ "inputs": [
59
+ {
60
+ "name": "version",
61
+ "type": "uint64",
62
+ "indexed": false,
63
+ "internalType": "uint64"
64
+ }
65
+ ],
66
+ "anonymous": false
67
+ },
68
+ {
69
+ "type": "event",
70
+ "name": "OwnershipTransferStarted",
71
+ "inputs": [
72
+ {
73
+ "name": "previousOwner",
74
+ "type": "address",
75
+ "indexed": true,
76
+ "internalType": "address"
77
+ },
78
+ {
79
+ "name": "newOwner",
80
+ "type": "address",
81
+ "indexed": true,
82
+ "internalType": "address"
83
+ }
84
+ ],
85
+ "anonymous": false
86
+ },
87
+ {
88
+ "type": "event",
89
+ "name": "OwnershipTransferred",
90
+ "inputs": [
91
+ {
92
+ "name": "previousOwner",
93
+ "type": "address",
94
+ "indexed": true,
95
+ "internalType": "address"
96
+ },
97
+ {
98
+ "name": "newOwner",
99
+ "type": "address",
100
+ "indexed": true,
101
+ "internalType": "address"
102
+ }
103
+ ],
104
+ "anonymous": false
105
+ },
106
+ {
107
+ "type": "error",
108
+ "name": "InvalidInitialization",
109
+ "inputs": []
110
+ },
111
+ {
112
+ "type": "error",
113
+ "name": "NotInitializing",
114
+ "inputs": []
115
+ },
116
+ {
117
+ "type": "error",
118
+ "name": "OwnableInvalidOwner",
119
+ "inputs": [
120
+ {
121
+ "name": "owner",
122
+ "type": "address",
123
+ "internalType": "address"
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "type": "error",
129
+ "name": "OwnableUnauthorizedAccount",
130
+ "inputs": [
131
+ {
132
+ "name": "account",
133
+ "type": "address",
134
+ "internalType": "address"
135
+ }
136
+ ]
137
+ }
138
+ ]
@@ -43,6 +43,13 @@
43
43
  ],
44
44
  "stateMutability": "view"
45
45
  },
46
+ {
47
+ "type": "function",
48
+ "name": "acceptOwnership",
49
+ "inputs": [],
50
+ "outputs": [],
51
+ "stateMutability": "nonpayable"
52
+ },
46
53
  {
47
54
  "type": "function",
48
55
  "name": "coinAddress",
@@ -546,6 +553,19 @@
546
553
  ],
547
554
  "stateMutability": "view"
548
555
  },
556
+ {
557
+ "type": "function",
558
+ "name": "pendingOwner",
559
+ "inputs": [],
560
+ "outputs": [
561
+ {
562
+ "name": "",
563
+ "type": "address",
564
+ "internalType": "address"
565
+ }
566
+ ],
567
+ "stateMutability": "view"
568
+ },
549
569
  {
550
570
  "type": "function",
551
571
  "name": "proxiableUUID",
@@ -877,6 +897,25 @@
877
897
  ],
878
898
  "anonymous": false
879
899
  },
900
+ {
901
+ "type": "event",
902
+ "name": "OwnershipTransferStarted",
903
+ "inputs": [
904
+ {
905
+ "name": "previousOwner",
906
+ "type": "address",
907
+ "indexed": true,
908
+ "internalType": "address"
909
+ },
910
+ {
911
+ "name": "newOwner",
912
+ "type": "address",
913
+ "indexed": true,
914
+ "internalType": "address"
915
+ }
916
+ ],
917
+ "anonymous": false
918
+ },
880
919
  {
881
920
  "type": "event",
882
921
  "name": "OwnershipTransferred",
@@ -3,12 +3,12 @@
3
3
  "COIN_V3_IMPL": "0x45Bf86430af7CD071Ea23aE52325A78C8d12aD5a",
4
4
  "COIN_V4_IMPL": "0xca72309AaF706d290E08608b1Af47943902f69b2",
5
5
  "COIN_VERSION": "1.1.0",
6
- "CREATOR_COIN_HOOK": "0x5e5D19d22c85A4aef7C1FdF25fB22A5a38f71040",
7
- "CREATOR_COIN_HOOK_SALT": "0x0000000000000000000000000000000000000000000000000000000000002989",
6
+ "CREATOR_COIN_HOOK": "0xd61A675F8a0c67A73DC3B54FB7318B4D91409040",
7
+ "CREATOR_COIN_HOOK_SALT": "0x0000000000000000000000000000000000000000000000000000000000000ae8",
8
8
  "CREATOR_COIN_IMPL": "0x88CC4E08C7608723f3E44e17aC669Fb43b6A8313",
9
9
  "HOOK_UPGRADE_GATE": "0xD88f6BdD765313CaFA5888C177c325E2C3AbF2D2",
10
10
  "ZORA_FACTORY": "0x777777751622c0d3258f214F9DF38E35BF45baF3",
11
- "ZORA_FACTORY_IMPL": "0x2dF69e41e848caA24aC3Dd1112C9DDC4F9E728F8",
12
- "ZORA_V4_COIN_HOOK": "0x5bF219b3Cc11E3f6Dd8dc8fC89D7d1deB0431040",
13
- "ZORA_V4_COIN_HOOK_SALT": "0x00000000000000000000000000000000000000000000000000000000000003c3"
11
+ "ZORA_FACTORY_IMPL": "0x0e2ea62E5377D46FeF114A60AfBE3d5eA7490577",
12
+ "ZORA_V4_COIN_HOOK": "0x9ea932730A7787000042e34390B8E435dD839040",
13
+ "ZORA_V4_COIN_HOOK_SALT": "0x0000000000000000000000000000000000000000000000000000000000002fa2"
14
14
  }
package/dist/index.cjs CHANGED
@@ -23,7 +23,7 @@ __export(index_exports, {
23
23
  autoSwapperABI: () => autoSwapperABI,
24
24
  buySupplyWithSwapRouterHookABI: () => buySupplyWithSwapRouterHookABI,
25
25
  coinABI: () => coinABI,
26
- coinV4ABI: () => coinV4ABI,
26
+ contentCoinABI: () => contentCoinABI,
27
27
  creatorCoinABI: () => creatorCoinABI,
28
28
  iPermit2ABI: () => iPermit2ABI,
29
29
  iPoolConfigEncodingABI: () => iPoolConfigEncodingABI,
@@ -1276,7 +1276,7 @@ var coinABI = [
1276
1276
  { type: "error", inputs: [], name: "SlippageBoundsExceeded" },
1277
1277
  { type: "error", inputs: [], name: "UseRevokeOwnershipToRemoveSelf" }
1278
1278
  ];
1279
- var coinV4ABI = [
1279
+ var contentCoinABI = [
1280
1280
  {
1281
1281
  type: "constructor",
1282
1282
  inputs: [
@@ -4216,6 +4216,13 @@ var zoraFactoryImplABI = [
4216
4216
  outputs: [{ name: "", internalType: "string", type: "string" }],
4217
4217
  stateMutability: "view"
4218
4218
  },
4219
+ {
4220
+ type: "function",
4221
+ inputs: [],
4222
+ name: "acceptOwnership",
4223
+ outputs: [],
4224
+ stateMutability: "nonpayable"
4225
+ },
4219
4226
  {
4220
4227
  type: "function",
4221
4228
  inputs: [
@@ -4405,6 +4412,13 @@ var zoraFactoryImplABI = [
4405
4412
  outputs: [{ name: "", internalType: "address", type: "address" }],
4406
4413
  stateMutability: "view"
4407
4414
  },
4415
+ {
4416
+ type: "function",
4417
+ inputs: [],
4418
+ name: "pendingOwner",
4419
+ outputs: [{ name: "", internalType: "address", type: "address" }],
4420
+ stateMutability: "view"
4421
+ },
4408
4422
  {
4409
4423
  type: "function",
4410
4424
  inputs: [],
@@ -4646,6 +4660,25 @@ var zoraFactoryImplABI = [
4646
4660
  ],
4647
4661
  name: "Initialized"
4648
4662
  },
4663
+ {
4664
+ type: "event",
4665
+ anonymous: false,
4666
+ inputs: [
4667
+ {
4668
+ name: "previousOwner",
4669
+ internalType: "address",
4670
+ type: "address",
4671
+ indexed: true
4672
+ },
4673
+ {
4674
+ name: "newOwner",
4675
+ internalType: "address",
4676
+ type: "address",
4677
+ indexed: true
4678
+ }
4679
+ ],
4680
+ name: "OwnershipTransferStarted"
4681
+ },
4649
4682
  {
4650
4683
  type: "event",
4651
4684
  anonymous: false,
@@ -4772,7 +4805,7 @@ var zoraFactoryImplABI = [
4772
4805
  autoSwapperABI,
4773
4806
  buySupplyWithSwapRouterHookABI,
4774
4807
  coinABI,
4775
- coinV4ABI,
4808
+ contentCoinABI,
4776
4809
  creatorCoinABI,
4777
4810
  iPermit2ABI,
4778
4811
  iPoolConfigEncodingABI,