@zoralabs/coins 0.7.1 → 0.9.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 (104) hide show
  1. package/.env +1 -0
  2. package/.turbo/turbo-build.log +114 -109
  3. package/.turbo/turbo-update-contract-version.log +22 -0
  4. package/CHANGELOG.md +28 -0
  5. package/abis/BadImpl.json +15 -0
  6. package/abis/BalanceDeltaLibrary.json +15 -0
  7. package/abis/BaseCoin.json +1442 -0
  8. package/abis/BaseCoinDeployHook.json +78 -0
  9. package/abis/BaseHook.json +897 -0
  10. package/abis/BaseTest.json +13 -91
  11. package/abis/BeforeSwapDeltaLibrary.json +15 -0
  12. package/abis/BuySupplyWithSwapRouterHook.json +126 -0
  13. package/abis/Coin.json +48 -92
  14. package/abis/CoinConstants.json +65 -0
  15. package/abis/CoinTest.json +13 -91
  16. package/abis/CoinV4.json +1664 -0
  17. package/abis/CurrencyLibrary.json +25 -0
  18. package/abis/DeployHooks.json +9 -0
  19. package/abis/DopplerUniswapV3Test.json +13 -91
  20. package/abis/FactoryTest.json +13 -91
  21. package/abis/FakeHookNoInterface.json +21 -0
  22. package/abis/HookDeployer.json +68 -0
  23. package/abis/Hooks.json +28 -0
  24. package/abis/HooksTest.json +651 -0
  25. package/abis/IAllowanceTransfer.json +486 -0
  26. package/abis/ICoin.json +25 -1
  27. package/abis/ICoinDeployHook.json +31 -0
  28. package/abis/IContractMetadata.json +28 -0
  29. package/abis/IEIP712.json +15 -0
  30. package/abis/IEIP712_v4.json +15 -0
  31. package/abis/IERC20Minimal.json +172 -0
  32. package/abis/IERC6909Claims.json +288 -0
  33. package/abis/IERC721Permit_v4.json +88 -0
  34. package/abis/IExtsload.json +64 -0
  35. package/abis/IExttload.json +40 -0
  36. package/abis/IHasAfterCoinDeploy.json +31 -0
  37. package/abis/IHasContractName.json +15 -0
  38. package/abis/IHookDeployer.json +42 -0
  39. package/abis/IHooks.json +789 -0
  40. package/abis/IImmutableState.json +15 -0
  41. package/abis/IMulticall_v4.json +21 -0
  42. package/abis/INotifier.json +187 -0
  43. package/abis/IPermit2.json +865 -0
  44. package/abis/IPermit2Forwarder.json +138 -0
  45. package/abis/IPoolInitializer_v4.json +53 -0
  46. package/abis/IPoolManager.json +1286 -0
  47. package/abis/IPositionManager.json +712 -0
  48. package/abis/IProtocolFees.json +174 -0
  49. package/abis/ISignatureTransfer.json +394 -0
  50. package/abis/ISubscriber.json +89 -0
  51. package/abis/ISwapRouter.json +82 -0
  52. package/abis/IUnorderedNonce.json +44 -0
  53. package/abis/IV4Router.json +47 -0
  54. package/abis/IZoraFactory.json +144 -0
  55. package/abis/IZoraV4CoinHook.json +83 -0
  56. package/abis/ImmutableState.json +36 -0
  57. package/abis/LPFeeLibrary.json +65 -0
  58. package/abis/MultiOwnableTest.json +13 -91
  59. package/abis/Simulate.json +0 -91
  60. package/abis/UniV3BuySell.json +12 -0
  61. package/abis/UniV3Errors.json +32 -0
  62. package/abis/UpgradeFactoryImpl.json +9 -0
  63. package/abis/UpgradesTest.json +604 -0
  64. package/abis/ZoraFactoryImpl.json +111 -0
  65. package/abis/ZoraV4CoinHook.json +989 -0
  66. package/addresses/8453.json +2 -1
  67. package/addresses/84532.json +4 -3
  68. package/dist/index.cjs +125 -62
  69. package/dist/index.cjs.map +1 -1
  70. package/dist/index.js +120 -56
  71. package/dist/index.js.map +1 -1
  72. package/dist/wagmiGenerated.d.ts +212 -464
  73. package/dist/wagmiGenerated.d.ts.map +1 -1
  74. package/package/wagmiGenerated.ts +122 -66
  75. package/package.json +4 -4
  76. package/script/CoinsDeployerBase.sol +32 -0
  77. package/script/DeployHooks.s.sol +22 -0
  78. package/script/Simulate.s.sol +3 -2
  79. package/script/UpgradeCoinImpl.sol +2 -2
  80. package/script/UpgradeFactoryImpl.s.sol +23 -0
  81. package/src/Coin.sol +35 -342
  82. package/src/ZoraFactoryImpl.sol +73 -45
  83. package/src/hooks/BaseCoinDeployHook.sol +62 -0
  84. package/src/hooks/BuySupplyWithSwapRouterHook.sol +78 -0
  85. package/src/interfaces/ICoin.sol +5 -1
  86. package/src/interfaces/ICoinDeployHook.sol +8 -0
  87. package/src/interfaces/ISwapRouter.sol +1 -35
  88. package/src/interfaces/IZoraFactory.sol +52 -0
  89. package/src/{utils → libs}/CoinConstants.sol +6 -6
  90. package/src/libs/CoinLegacy.sol +4 -4
  91. package/src/libs/CoinLegacyMarket.sol +182 -0
  92. package/src/libs/CoinSetupV3.sol +111 -0
  93. package/src/libs/UniV3BuySell.sol +449 -0
  94. package/src/libs/UniV3Errors.sol +11 -0
  95. package/src/version/ContractVersionBase.sol +1 -1
  96. package/test/Coin.t.sol +20 -17
  97. package/test/CoinDopplerUniV3.t.sol +7 -17
  98. package/test/Factory.t.sol +4 -3
  99. package/test/Hooks.t.sol +274 -0
  100. package/test/Upgrades.t.sol +67 -0
  101. package/test/utils/BaseTest.sol +18 -3
  102. package/wagmi.config.ts +6 -9
  103. package/src/libs/CoinSetup.sol +0 -37
  104. /package/abis/{CoinSetup.json → CoinSetupV3.json} +0 -0
package/dist/index.js CHANGED
@@ -1,76 +1,83 @@
1
1
  // package/wagmiGenerated.ts
2
- var coinABI = [
2
+ var buySupplyWithSwapRouterHookABI = [
3
3
  {
4
4
  type: "constructor",
5
5
  inputs: [
6
6
  {
7
- name: "_protocolRewardRecipient",
8
- internalType: "address",
7
+ name: "_factory",
8
+ internalType: "contract IZoraFactory",
9
9
  type: "address"
10
10
  },
11
- { name: "_protocolRewards", internalType: "address", type: "address" },
12
- { name: "_weth", internalType: "address", type: "address" },
13
- { name: "_v3Factory", internalType: "address", type: "address" },
14
- { name: "_swapRouter", internalType: "address", type: "address" },
15
- { name: "_airlock", internalType: "address", type: "address" }
11
+ { name: "_swapRouter", internalType: "address", type: "address" }
16
12
  ],
17
13
  stateMutability: "nonpayable"
18
14
  },
19
- { type: "receive", stateMutability: "payable" },
20
- {
21
- type: "function",
22
- inputs: [],
23
- name: "DOMAIN_SEPARATOR",
24
- outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
25
- stateMutability: "view"
26
- },
27
15
  {
28
16
  type: "function",
29
- inputs: [],
30
- name: "MAX_TOTAL_SUPPLY",
31
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
32
- stateMutability: "view"
17
+ inputs: [
18
+ { name: "sender", internalType: "address", type: "address" },
19
+ { name: "coin", internalType: "contract ICoin", type: "address" },
20
+ { name: "hookData", internalType: "bytes", type: "bytes" }
21
+ ],
22
+ name: "afterCoinDeploy",
23
+ outputs: [{ name: "", internalType: "bytes", type: "bytes" }],
24
+ stateMutability: "payable"
33
25
  },
34
26
  {
35
27
  type: "function",
36
28
  inputs: [],
37
- name: "MIN_ORDER_SIZE",
38
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
29
+ name: "factory",
30
+ outputs: [
31
+ { name: "", internalType: "contract IZoraFactory", type: "address" }
32
+ ],
39
33
  stateMutability: "view"
40
34
  },
41
35
  {
42
36
  type: "function",
43
- inputs: [],
44
- name: "PLATFORM_REFERRER_FEE_BPS",
45
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
46
- stateMutability: "view"
37
+ inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }],
38
+ name: "supportsInterface",
39
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
40
+ stateMutability: "pure"
47
41
  },
42
+ { type: "error", inputs: [], name: "AddressZero" },
48
43
  {
49
- type: "function",
50
- inputs: [],
51
- name: "PROTOCOL_FEE_BPS",
52
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
53
- stateMutability: "view"
44
+ type: "error",
45
+ inputs: [{ name: "balance", internalType: "uint256", type: "uint256" }],
46
+ name: "CoinBalanceNot0"
54
47
  },
48
+ { type: "error", inputs: [], name: "Erc20NotReceived" },
49
+ { type: "error", inputs: [], name: "HookNotImplemented" },
50
+ { type: "error", inputs: [], name: "InvalidSwapRouterCall" },
51
+ { type: "error", inputs: [], name: "NotFactory" },
55
52
  {
56
- type: "function",
57
- inputs: [],
58
- name: "TOKEN_CREATOR_FEE_BPS",
59
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
60
- stateMutability: "view"
61
- },
53
+ type: "error",
54
+ inputs: [{ name: "error", internalType: "bytes", type: "bytes" }],
55
+ name: "SwapReverted"
56
+ }
57
+ ];
58
+ var coinABI = [
62
59
  {
63
- type: "function",
64
- inputs: [],
65
- name: "TOTAL_FEE_BPS",
66
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
67
- stateMutability: "view"
60
+ type: "constructor",
61
+ inputs: [
62
+ {
63
+ name: "_protocolRewardRecipient",
64
+ internalType: "address",
65
+ type: "address"
66
+ },
67
+ { name: "_protocolRewards", internalType: "address", type: "address" },
68
+ { name: "_weth", internalType: "address", type: "address" },
69
+ { name: "_v3Factory", internalType: "address", type: "address" },
70
+ { name: "_swapRouter", internalType: "address", type: "address" },
71
+ { name: "_airlock", internalType: "address", type: "address" }
72
+ ],
73
+ stateMutability: "nonpayable"
68
74
  },
75
+ { type: "receive", stateMutability: "payable" },
69
76
  {
70
77
  type: "function",
71
78
  inputs: [],
72
- name: "TRADE_REFERRER_FEE_BPS",
73
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
79
+ name: "DOMAIN_SEPARATOR",
80
+ outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
74
81
  stateMutability: "view"
75
82
  },
76
83
  {
@@ -225,6 +232,20 @@ var coinABI = [
225
232
  outputs: [{ name: "", internalType: "bool", type: "bool" }],
226
233
  stateMutability: "view"
227
234
  },
235
+ {
236
+ type: "function",
237
+ inputs: [],
238
+ name: "market",
239
+ outputs: [{ name: "", internalType: "bytes", type: "bytes" }],
240
+ stateMutability: "view"
241
+ },
242
+ {
243
+ type: "function",
244
+ inputs: [],
245
+ name: "marketVersion",
246
+ outputs: [{ name: "", internalType: "uint8", type: "uint8" }],
247
+ stateMutability: "view"
248
+ },
228
249
  {
229
250
  type: "function",
230
251
  inputs: [],
@@ -870,6 +891,7 @@ var coinABI = [
870
891
  name: "AddressInsufficientBalance"
871
892
  },
872
893
  { type: "error", inputs: [], name: "AddressZero" },
894
+ { type: "error", inputs: [], name: "AddressZero" },
873
895
  { type: "error", inputs: [], name: "AlreadyOwner" },
874
896
  { type: "error", inputs: [], name: "CannotMintZeroLiquidity" },
875
897
  {
@@ -960,6 +982,7 @@ var coinABI = [
960
982
  { type: "error", inputs: [], name: "InvalidInitialization" },
961
983
  { type: "error", inputs: [], name: "InvalidMarketType" },
962
984
  { type: "error", inputs: [], name: "InvalidPoolVersion" },
985
+ { type: "error", inputs: [], name: "InvalidPoolVersion" },
963
986
  {
964
987
  type: "error",
965
988
  inputs: [
@@ -985,7 +1008,14 @@ var coinABI = [
985
1008
  { type: "error", inputs: [], name: "NumDiscoveryPositionsOutOfRange" },
986
1009
  { type: "error", inputs: [], name: "OneOwnerRequired" },
987
1010
  { type: "error", inputs: [], name: "OnlyOwner" },
988
- { type: "error", inputs: [], name: "OnlyPool" },
1011
+ {
1012
+ type: "error",
1013
+ inputs: [
1014
+ { name: "sender", internalType: "address", type: "address" },
1015
+ { name: "pool", internalType: "address", type: "address" }
1016
+ ],
1017
+ name: "OnlyPool"
1018
+ },
989
1019
  { type: "error", inputs: [], name: "OnlyWeth" },
990
1020
  { type: "error", inputs: [], name: "OwnerCannotBeAddressZero" },
991
1021
  { type: "error", inputs: [], name: "ReentrancyGuardReentrantCall" },
@@ -1148,6 +1178,20 @@ var zoraFactoryImplABI = [
1148
1178
  outputs: [{ name: "", internalType: "address", type: "address" }],
1149
1179
  stateMutability: "view"
1150
1180
  },
1181
+ {
1182
+ type: "function",
1183
+ inputs: [],
1184
+ name: "contractName",
1185
+ outputs: [{ name: "", internalType: "string", type: "string" }],
1186
+ stateMutability: "pure"
1187
+ },
1188
+ {
1189
+ type: "function",
1190
+ inputs: [],
1191
+ name: "contractVersion",
1192
+ outputs: [{ name: "", internalType: "string", type: "string" }],
1193
+ stateMutability: "pure"
1194
+ },
1151
1195
  {
1152
1196
  type: "function",
1153
1197
  inputs: [
@@ -1187,6 +1231,26 @@ var zoraFactoryImplABI = [
1187
1231
  ],
1188
1232
  stateMutability: "payable"
1189
1233
  },
1234
+ {
1235
+ type: "function",
1236
+ inputs: [
1237
+ { name: "payoutRecipient", internalType: "address", type: "address" },
1238
+ { name: "owners", internalType: "address[]", type: "address[]" },
1239
+ { name: "uri", internalType: "string", type: "string" },
1240
+ { name: "name", internalType: "string", type: "string" },
1241
+ { name: "symbol", internalType: "string", type: "string" },
1242
+ { name: "poolConfig", internalType: "bytes", type: "bytes" },
1243
+ { name: "platformReferrer", internalType: "address", type: "address" },
1244
+ { name: "hook", internalType: "address", type: "address" },
1245
+ { name: "hookData", internalType: "bytes", type: "bytes" }
1246
+ ],
1247
+ name: "deployWithHook",
1248
+ outputs: [
1249
+ { name: "coin", internalType: "address", type: "address" },
1250
+ { name: "hookDataOut", internalType: "bytes", type: "bytes" }
1251
+ ],
1252
+ stateMutability: "payable"
1253
+ },
1190
1254
  {
1191
1255
  type: "function",
1192
1256
  inputs: [],
@@ -1365,6 +1429,7 @@ var zoraFactoryImplABI = [
1365
1429
  { type: "error", inputs: [], name: "ERC20TransferAmountMismatch" },
1366
1430
  { type: "error", inputs: [], name: "EthTransferInvalid" },
1367
1431
  { type: "error", inputs: [], name: "FailedInnerCall" },
1432
+ { type: "error", inputs: [], name: "InvalidHook" },
1368
1433
  { type: "error", inputs: [], name: "InvalidInitialization" },
1369
1434
  { type: "error", inputs: [], name: "NotInitializing" },
1370
1435
  {
@@ -1388,21 +1453,20 @@ var zoraFactoryImplABI = [
1388
1453
  type: "error",
1389
1454
  inputs: [{ name: "slot", internalType: "bytes32", type: "bytes32" }],
1390
1455
  name: "UUPSUnsupportedProxiableUUID"
1456
+ },
1457
+ {
1458
+ type: "error",
1459
+ inputs: [
1460
+ { name: "currentName", internalType: "string", type: "string" },
1461
+ { name: "newName", internalType: "string", type: "string" }
1462
+ ],
1463
+ name: "UpgradeToMismatchedContractName"
1391
1464
  }
1392
1465
  ];
1393
- var zoraFactoryImplAddress = {
1394
- 8453: "0x777777751622c0d3258f214F9DF38E35BF45baF3",
1395
- 84532: "0x777777751622c0d3258f214F9DF38E35BF45baF3"
1396
- };
1397
- var zoraFactoryImplConfig = {
1398
- address: zoraFactoryImplAddress,
1399
- abi: zoraFactoryImplABI
1400
- };
1401
1466
  export {
1467
+ buySupplyWithSwapRouterHookABI,
1402
1468
  coinABI,
1403
1469
  iUniswapV3PoolABI,
1404
- zoraFactoryImplABI,
1405
- zoraFactoryImplAddress,
1406
- zoraFactoryImplConfig
1470
+ zoraFactoryImplABI
1407
1471
  };
1408
1472
  //# sourceMappingURL=index.js.map