@zoralabs/coins 1.1.0 → 1.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 (47) hide show
  1. package/.turbo/turbo-build.log +97 -95
  2. package/CHANGELOG.md +8 -0
  3. package/abis/BaseCoin.json +6 -1
  4. package/abis/BaseZoraV4CoinHook.json +119 -0
  5. package/abis/Coin.json +6 -1
  6. package/abis/CoinTest.json +14 -0
  7. package/abis/CoinV4.json +6 -1
  8. package/abis/ContentCoinHook.json +119 -0
  9. package/abis/CreatorCoin.json +6 -1
  10. package/abis/CreatorCoinHook.json +119 -0
  11. package/abis/ERC165.json +21 -0
  12. package/abis/ERC165Upgradeable.json +44 -0
  13. package/abis/FeeEstimatorHook.json +119 -0
  14. package/abis/ICoin.json +5 -0
  15. package/abis/ICoinV3.json +5 -0
  16. package/abis/ICoinV4.json +5 -0
  17. package/abis/ICreatorCoin.json +5 -0
  18. package/abis/LiquidityMigrationTest.json +7 -0
  19. package/abis/UpgradeHooks.json +35 -0
  20. package/abis/UpgradesTest.json +21 -0
  21. package/addresses/8453.json +11 -7
  22. package/dist/index.cjs +6 -3
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.js +6 -3
  25. package/dist/index.js.map +1 -1
  26. package/dist/wagmiGenerated.d.ts +15 -3
  27. package/dist/wagmiGenerated.d.ts.map +1 -1
  28. package/package/wagmiGenerated.ts +6 -3
  29. package/package.json +1 -1
  30. package/script/DeployUpgradeGate.s.sol +1 -1
  31. package/script/PrintRegisterUpgradePath.s.sol +35 -0
  32. package/script/UpgradeCoinImpl.sol +1 -1
  33. package/script/UpgradeHooks.s.sol +23 -0
  34. package/src/BaseCoin.sol +25 -8
  35. package/src/CoinV4.sol +2 -2
  36. package/src/deployment/CoinsDeployerBase.sol +29 -9
  37. package/src/hooks/BaseZoraV4CoinHook.sol +117 -3
  38. package/src/interfaces/ICoin.sol +3 -0
  39. package/src/libs/CoinRewardsV4.sol +18 -4
  40. package/src/libs/HooksDeployment.sol +13 -0
  41. package/src/libs/V4Liquidity.sol +27 -0
  42. package/src/version/ContractVersionBase.sol +1 -1
  43. package/test/Coin.t.sol +23 -0
  44. package/test/LiquidityMigration.t.sol +27 -0
  45. package/test/Upgrades.t.sol +180 -1
  46. package/test/utils/BaseTest.sol +5 -1
  47. /package/script/{DeployHooks.s.sol → DeployPostDeploymentHooks.s.sol} +0 -0
@@ -901,7 +901,7 @@
901
901
  "internalType": "bool"
902
902
  }
903
903
  ],
904
- "stateMutability": "pure"
904
+ "stateMutability": "view"
905
905
  },
906
906
  {
907
907
  "type": "function",
@@ -1899,6 +1899,11 @@
1899
1899
  }
1900
1900
  ]
1901
1901
  },
1902
+ {
1903
+ "type": "error",
1904
+ "name": "NameIsRequired",
1905
+ "inputs": []
1906
+ },
1902
1907
  {
1903
1908
  "type": "error",
1904
1909
  "name": "NotInitializing",
@@ -812,6 +812,19 @@
812
812
  ],
813
813
  "stateMutability": "nonpayable"
814
814
  },
815
+ {
816
+ "type": "function",
817
+ "name": "contractVersion",
818
+ "inputs": [],
819
+ "outputs": [
820
+ {
821
+ "name": "",
822
+ "type": "string",
823
+ "internalType": "string"
824
+ }
825
+ ],
826
+ "stateMutability": "pure"
827
+ },
815
828
  {
816
829
  "type": "function",
817
830
  "name": "getHookPermissions",
@@ -1020,6 +1033,88 @@
1020
1033
  ],
1021
1034
  "stateMutability": "view"
1022
1035
  },
1036
+ {
1037
+ "type": "function",
1038
+ "name": "initializeFromMigration",
1039
+ "inputs": [
1040
+ {
1041
+ "name": "poolKey",
1042
+ "type": "tuple",
1043
+ "internalType": "struct PoolKey",
1044
+ "components": [
1045
+ {
1046
+ "name": "currency0",
1047
+ "type": "address",
1048
+ "internalType": "Currency"
1049
+ },
1050
+ {
1051
+ "name": "currency1",
1052
+ "type": "address",
1053
+ "internalType": "Currency"
1054
+ },
1055
+ {
1056
+ "name": "fee",
1057
+ "type": "uint24",
1058
+ "internalType": "uint24"
1059
+ },
1060
+ {
1061
+ "name": "tickSpacing",
1062
+ "type": "int24",
1063
+ "internalType": "int24"
1064
+ },
1065
+ {
1066
+ "name": "hooks",
1067
+ "type": "address",
1068
+ "internalType": "contract IHooks"
1069
+ }
1070
+ ]
1071
+ },
1072
+ {
1073
+ "name": "coin",
1074
+ "type": "address",
1075
+ "internalType": "address"
1076
+ },
1077
+ {
1078
+ "name": "sqrtPriceX96",
1079
+ "type": "uint160",
1080
+ "internalType": "uint160"
1081
+ },
1082
+ {
1083
+ "name": "migratedLiquidity",
1084
+ "type": "tuple[]",
1085
+ "internalType": "struct BurnedPosition[]",
1086
+ "components": [
1087
+ {
1088
+ "name": "tickLower",
1089
+ "type": "int24",
1090
+ "internalType": "int24"
1091
+ },
1092
+ {
1093
+ "name": "tickUpper",
1094
+ "type": "int24",
1095
+ "internalType": "int24"
1096
+ },
1097
+ {
1098
+ "name": "amount0Received",
1099
+ "type": "uint128",
1100
+ "internalType": "uint128"
1101
+ },
1102
+ {
1103
+ "name": "amount1Received",
1104
+ "type": "uint128",
1105
+ "internalType": "uint128"
1106
+ }
1107
+ ]
1108
+ },
1109
+ {
1110
+ "name": "",
1111
+ "type": "bytes",
1112
+ "internalType": "bytes"
1113
+ }
1114
+ ],
1115
+ "outputs": [],
1116
+ "stateMutability": "nonpayable"
1117
+ },
1023
1118
  {
1024
1119
  "type": "function",
1025
1120
  "name": "isTrustedMessageSender",
@@ -1135,6 +1230,25 @@
1135
1230
  ],
1136
1231
  "stateMutability": "view"
1137
1232
  },
1233
+ {
1234
+ "type": "function",
1235
+ "name": "supportsInterface",
1236
+ "inputs": [
1237
+ {
1238
+ "name": "interfaceId",
1239
+ "type": "bytes4",
1240
+ "internalType": "bytes4"
1241
+ }
1242
+ ],
1243
+ "outputs": [
1244
+ {
1245
+ "name": "",
1246
+ "type": "bool",
1247
+ "internalType": "bool"
1248
+ }
1249
+ ],
1250
+ "stateMutability": "view"
1251
+ },
1138
1252
  {
1139
1253
  "type": "function",
1140
1254
  "name": "unlockCallback",
@@ -1618,6 +1732,11 @@
1618
1732
  "name": "PathMustHaveAtLeastOneStep",
1619
1733
  "inputs": []
1620
1734
  },
1735
+ {
1736
+ "type": "error",
1737
+ "name": "SafeCastOverflow",
1738
+ "inputs": []
1739
+ },
1621
1740
  {
1622
1741
  "type": "error",
1623
1742
  "name": "SafeERC20FailedOperation",
@@ -0,0 +1,21 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "supportsInterface",
5
+ "inputs": [
6
+ {
7
+ "name": "interfaceId",
8
+ "type": "bytes4",
9
+ "internalType": "bytes4"
10
+ }
11
+ ],
12
+ "outputs": [
13
+ {
14
+ "name": "",
15
+ "type": "bool",
16
+ "internalType": "bool"
17
+ }
18
+ ],
19
+ "stateMutability": "view"
20
+ }
21
+ ]
@@ -0,0 +1,44 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "supportsInterface",
5
+ "inputs": [
6
+ {
7
+ "name": "interfaceId",
8
+ "type": "bytes4",
9
+ "internalType": "bytes4"
10
+ }
11
+ ],
12
+ "outputs": [
13
+ {
14
+ "name": "",
15
+ "type": "bool",
16
+ "internalType": "bool"
17
+ }
18
+ ],
19
+ "stateMutability": "view"
20
+ },
21
+ {
22
+ "type": "event",
23
+ "name": "Initialized",
24
+ "inputs": [
25
+ {
26
+ "name": "version",
27
+ "type": "uint64",
28
+ "indexed": false,
29
+ "internalType": "uint64"
30
+ }
31
+ ],
32
+ "anonymous": false
33
+ },
34
+ {
35
+ "type": "error",
36
+ "name": "InvalidInitialization",
37
+ "inputs": []
38
+ },
39
+ {
40
+ "type": "error",
41
+ "name": "NotInitializing",
42
+ "inputs": []
43
+ }
44
+ ]
@@ -812,6 +812,19 @@
812
812
  ],
813
813
  "stateMutability": "nonpayable"
814
814
  },
815
+ {
816
+ "type": "function",
817
+ "name": "contractVersion",
818
+ "inputs": [],
819
+ "outputs": [
820
+ {
821
+ "name": "",
822
+ "type": "string",
823
+ "internalType": "string"
824
+ }
825
+ ],
826
+ "stateMutability": "pure"
827
+ },
815
828
  {
816
829
  "type": "function",
817
830
  "name": "feeState",
@@ -1157,6 +1170,88 @@
1157
1170
  ],
1158
1171
  "stateMutability": "view"
1159
1172
  },
1173
+ {
1174
+ "type": "function",
1175
+ "name": "initializeFromMigration",
1176
+ "inputs": [
1177
+ {
1178
+ "name": "poolKey",
1179
+ "type": "tuple",
1180
+ "internalType": "struct PoolKey",
1181
+ "components": [
1182
+ {
1183
+ "name": "currency0",
1184
+ "type": "address",
1185
+ "internalType": "Currency"
1186
+ },
1187
+ {
1188
+ "name": "currency1",
1189
+ "type": "address",
1190
+ "internalType": "Currency"
1191
+ },
1192
+ {
1193
+ "name": "fee",
1194
+ "type": "uint24",
1195
+ "internalType": "uint24"
1196
+ },
1197
+ {
1198
+ "name": "tickSpacing",
1199
+ "type": "int24",
1200
+ "internalType": "int24"
1201
+ },
1202
+ {
1203
+ "name": "hooks",
1204
+ "type": "address",
1205
+ "internalType": "contract IHooks"
1206
+ }
1207
+ ]
1208
+ },
1209
+ {
1210
+ "name": "coin",
1211
+ "type": "address",
1212
+ "internalType": "address"
1213
+ },
1214
+ {
1215
+ "name": "sqrtPriceX96",
1216
+ "type": "uint160",
1217
+ "internalType": "uint160"
1218
+ },
1219
+ {
1220
+ "name": "migratedLiquidity",
1221
+ "type": "tuple[]",
1222
+ "internalType": "struct BurnedPosition[]",
1223
+ "components": [
1224
+ {
1225
+ "name": "tickLower",
1226
+ "type": "int24",
1227
+ "internalType": "int24"
1228
+ },
1229
+ {
1230
+ "name": "tickUpper",
1231
+ "type": "int24",
1232
+ "internalType": "int24"
1233
+ },
1234
+ {
1235
+ "name": "amount0Received",
1236
+ "type": "uint128",
1237
+ "internalType": "uint128"
1238
+ },
1239
+ {
1240
+ "name": "amount1Received",
1241
+ "type": "uint128",
1242
+ "internalType": "uint128"
1243
+ }
1244
+ ]
1245
+ },
1246
+ {
1247
+ "name": "",
1248
+ "type": "bytes",
1249
+ "internalType": "bytes"
1250
+ }
1251
+ ],
1252
+ "outputs": [],
1253
+ "stateMutability": "nonpayable"
1254
+ },
1160
1255
  {
1161
1256
  "type": "function",
1162
1257
  "name": "isTrustedMessageSender",
@@ -1272,6 +1367,25 @@
1272
1367
  ],
1273
1368
  "stateMutability": "view"
1274
1369
  },
1370
+ {
1371
+ "type": "function",
1372
+ "name": "supportsInterface",
1373
+ "inputs": [
1374
+ {
1375
+ "name": "interfaceId",
1376
+ "type": "bytes4",
1377
+ "internalType": "bytes4"
1378
+ }
1379
+ ],
1380
+ "outputs": [
1381
+ {
1382
+ "name": "",
1383
+ "type": "bool",
1384
+ "internalType": "bool"
1385
+ }
1386
+ ],
1387
+ "stateMutability": "view"
1388
+ },
1275
1389
  {
1276
1390
  "type": "function",
1277
1391
  "name": "unlockCallback",
@@ -1680,6 +1794,11 @@
1680
1794
  "name": "PathMustHaveAtLeastOneStep",
1681
1795
  "inputs": []
1682
1796
  },
1797
+ {
1798
+ "type": "error",
1799
+ "name": "SafeCastOverflow",
1800
+ "inputs": []
1801
+ },
1683
1802
  {
1684
1803
  "type": "error",
1685
1804
  "name": "UpgradeGateCannotBeZeroAddress",
package/abis/ICoin.json CHANGED
@@ -631,6 +631,11 @@
631
631
  }
632
632
  ]
633
633
  },
634
+ {
635
+ "type": "error",
636
+ "name": "NameIsRequired",
637
+ "inputs": []
638
+ },
634
639
  {
635
640
  "type": "error",
636
641
  "name": "NumDiscoveryPositionsOutOfRange",
package/abis/ICoinV3.json CHANGED
@@ -888,6 +888,11 @@
888
888
  }
889
889
  ]
890
890
  },
891
+ {
892
+ "type": "error",
893
+ "name": "NameIsRequired",
894
+ "inputs": []
895
+ },
891
896
  {
892
897
  "type": "error",
893
898
  "name": "NumDiscoveryPositionsOutOfRange",
package/abis/ICoinV4.json CHANGED
@@ -1009,6 +1009,11 @@
1009
1009
  }
1010
1010
  ]
1011
1011
  },
1012
+ {
1013
+ "type": "error",
1014
+ "name": "NameIsRequired",
1015
+ "inputs": []
1016
+ },
1012
1017
  {
1013
1018
  "type": "error",
1014
1019
  "name": "NumDiscoveryPositionsOutOfRange",
@@ -1064,6 +1064,11 @@
1064
1064
  }
1065
1065
  ]
1066
1066
  },
1067
+ {
1068
+ "type": "error",
1069
+ "name": "NameIsRequired",
1070
+ "inputs": []
1071
+ },
1067
1072
  {
1068
1073
  "type": "error",
1069
1074
  "name": "NumDiscoveryPositionsOutOfRange",
@@ -254,6 +254,13 @@
254
254
  "outputs": [],
255
255
  "stateMutability": "nonpayable"
256
256
  },
257
+ {
258
+ "type": "function",
259
+ "name": "test_migrateLiquidity_enablesSwapsOnOldPoolKey",
260
+ "inputs": [],
261
+ "outputs": [],
262
+ "stateMutability": "nonpayable"
263
+ },
257
264
  {
258
265
  "type": "function",
259
266
  "name": "test_migrateLiquidity_migratesLiquidityToNewHook",
@@ -0,0 +1,35 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "run",
5
+ "inputs": [],
6
+ "outputs": [],
7
+ "stateMutability": "nonpayable"
8
+ },
9
+ {
10
+ "type": "error",
11
+ "name": "Create2EmptyBytecode",
12
+ "inputs": []
13
+ },
14
+ {
15
+ "type": "error",
16
+ "name": "Create2FailedDeployment",
17
+ "inputs": []
18
+ },
19
+ {
20
+ "type": "error",
21
+ "name": "Create2InsufficientBalance",
22
+ "inputs": [
23
+ {
24
+ "name": "balance",
25
+ "type": "uint256",
26
+ "internalType": "uint256"
27
+ },
28
+ {
29
+ "name": "needed",
30
+ "type": "uint256",
31
+ "internalType": "uint256"
32
+ }
33
+ ]
34
+ }
35
+ ]
@@ -260,6 +260,13 @@
260
260
  ],
261
261
  "stateMutability": "view"
262
262
  },
263
+ {
264
+ "type": "function",
265
+ "name": "test_canCanFixBrokenContentCoinAndSwap",
266
+ "inputs": [],
267
+ "outputs": [],
268
+ "stateMutability": "nonpayable"
269
+ },
263
270
  {
264
271
  "type": "function",
265
272
  "name": "test_canUpgradeAndSwap",
@@ -267,6 +274,20 @@
267
274
  "outputs": [],
268
275
  "stateMutability": "nonpayable"
269
276
  },
277
+ {
278
+ "type": "function",
279
+ "name": "test_canUpgradeBrokenContentCoinAndSwap",
280
+ "inputs": [],
281
+ "outputs": [],
282
+ "stateMutability": "nonpayable"
283
+ },
284
+ {
285
+ "type": "function",
286
+ "name": "test_canUpgradeBrokenCreatorCoinAndSwap",
287
+ "inputs": [],
288
+ "outputs": [],
289
+ "stateMutability": "nonpayable"
290
+ },
270
291
  {
271
292
  "type": "function",
272
293
  "name": "test_canUpgradeFromVersionWithoutContractName",
@@ -1,10 +1,14 @@
1
1
  {
2
- "BUY_SUPPLY_WITH_SWAP_ROUTER_HOOK": "0xd77038a7f400E8242d2916f7EB5741e689d4aE25",
3
- "COIN_V3_IMPL": "0xeBCc4B0Cf2cFD448616d3cb42C5825528b60317D",
4
- "COIN_V4_IMPL": "0x6e4317ED4020539c8F2327f62eb985294C857dCE",
5
- "COIN_VERSION": "1.0.0",
2
+ "BUY_SUPPLY_WITH_SWAP_ROUTER_HOOK": "0xc90e349360C43a0217CEF289f231C66D4748960F",
3
+ "COIN_V3_IMPL": "0x45Bf86430af7CD071Ea23aE52325A78C8d12aD5a",
4
+ "COIN_V4_IMPL": "0xca72309AaF706d290E08608b1Af47943902f69b2",
5
+ "COIN_VERSION": "1.1.0",
6
+ "CREATOR_COIN_HOOK": "0x5e5D19d22c85A4aef7C1FdF25fB22A5a38f71040",
7
+ "CREATOR_COIN_HOOK_SALT": "0x0000000000000000000000000000000000000000000000000000000000002989",
8
+ "CREATOR_COIN_IMPL": "0x88CC4E08C7608723f3E44e17aC669Fb43b6A8313",
9
+ "HOOK_UPGRADE_GATE": "0xD88f6BdD765313CaFA5888C177c325E2C3AbF2D2",
6
10
  "ZORA_FACTORY": "0x777777751622c0d3258f214F9DF38E35BF45baF3",
7
- "ZORA_FACTORY_IMPL": "0xED0EAe148FAF9810a0EA96c619be676bF0Cf0101",
8
- "ZORA_V4_COIN_HOOK": "0xA1eBdD5cA6470Bbd67114331387f2dDa7bfad040",
9
- "ZORA_V4_COIN_HOOK_SALT": "0x00000000000000000000000000000000000000000000000000000000000035af"
11
+ "ZORA_FACTORY_IMPL": "0x2dF69e41e848caA24aC3Dd1112C9DDC4F9E728F8",
12
+ "ZORA_V4_COIN_HOOK": "0x5bF219b3Cc11E3f6Dd8dc8fC89D7d1deB0431040",
13
+ "ZORA_V4_COIN_HOOK_SALT": "0x00000000000000000000000000000000000000000000000000000000000003c3"
10
14
  }
package/dist/index.cjs CHANGED
@@ -639,7 +639,7 @@ var coinABI = [
639
639
  inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }],
640
640
  name: "supportsInterface",
641
641
  outputs: [{ name: "", internalType: "bool", type: "bool" }],
642
- stateMutability: "pure"
642
+ stateMutability: "view"
643
643
  },
644
644
  {
645
645
  type: "function",
@@ -1251,6 +1251,7 @@ var coinABI = [
1251
1251
  ],
1252
1252
  name: "MaxShareToBeSoldExceeded"
1253
1253
  },
1254
+ { type: "error", inputs: [], name: "NameIsRequired" },
1254
1255
  { type: "error", inputs: [], name: "NotInitializing" },
1255
1256
  { type: "error", inputs: [], name: "NotOwner" },
1256
1257
  { type: "error", inputs: [], name: "NumDiscoveryPositionsOutOfRange" },
@@ -1716,7 +1717,7 @@ var coinV4ABI = [
1716
1717
  inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }],
1717
1718
  name: "supportsInterface",
1718
1719
  outputs: [{ name: "", internalType: "bool", type: "bool" }],
1719
- stateMutability: "pure"
1720
+ stateMutability: "view"
1720
1721
  },
1721
1722
  {
1722
1723
  type: "function",
@@ -2336,6 +2337,7 @@ var coinV4ABI = [
2336
2337
  ],
2337
2338
  name: "MaxShareToBeSoldExceeded"
2338
2339
  },
2340
+ { type: "error", inputs: [], name: "NameIsRequired" },
2339
2341
  { type: "error", inputs: [], name: "NotInitializing" },
2340
2342
  { type: "error", inputs: [], name: "NotOwner" },
2341
2343
  { type: "error", inputs: [], name: "NumDiscoveryPositionsOutOfRange" },
@@ -2810,7 +2812,7 @@ var creatorCoinABI = [
2810
2812
  inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }],
2811
2813
  name: "supportsInterface",
2812
2814
  outputs: [{ name: "", internalType: "bool", type: "bool" }],
2813
- stateMutability: "pure"
2815
+ stateMutability: "view"
2814
2816
  },
2815
2817
  {
2816
2818
  type: "function",
@@ -3489,6 +3491,7 @@ var creatorCoinABI = [
3489
3491
  ],
3490
3492
  name: "MaxShareToBeSoldExceeded"
3491
3493
  },
3494
+ { type: "error", inputs: [], name: "NameIsRequired" },
3492
3495
  { type: "error", inputs: [], name: "NotInitializing" },
3493
3496
  { type: "error", inputs: [], name: "NotOwner" },
3494
3497
  { type: "error", inputs: [], name: "NumDiscoveryPositionsOutOfRange" },