@zoralabs/coins 2.2.1 → 2.3.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 (54) hide show
  1. package/.turbo/turbo-build$colon$js.log +99 -99
  2. package/CHANGELOG.md +44 -5
  3. package/README.md +4 -0
  4. package/abis/BaseCoin.json +0 -5
  5. package/abis/ContentCoin.json +0 -5
  6. package/abis/CreatorCoin.json +0 -5
  7. package/abis/FeeEstimatorHook.json +94 -1
  8. package/abis/IUpgradeableDestinationV4HookWithUpdateableFee.json +95 -0
  9. package/abis/IZoraFactory.json +69 -0
  10. package/abis/ZoraFactoryImpl.json +69 -0
  11. package/abis/ZoraV4CoinHook.json +94 -1
  12. package/addresses/8453.json +6 -6
  13. package/audits/report-cantinacode-zora-0827.pdf +3498 -4
  14. package/dist/index.cjs +21 -3
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.js +21 -3
  17. package/dist/index.js.map +1 -1
  18. package/dist/wagmiGenerated.d.ts +54 -12
  19. package/dist/wagmiGenerated.d.ts.map +1 -1
  20. package/foundry.toml +3 -3
  21. package/package/wagmiGenerated.ts +21 -3
  22. package/package.json +1 -1
  23. package/script/TestBackingCoinSwap.s.sol +0 -2
  24. package/script/TestV4Swap.s.sol +0 -2
  25. package/src/BaseCoin.sol +4 -12
  26. package/src/ContentCoin.sol +3 -4
  27. package/src/CreatorCoin.sol +8 -10
  28. package/src/ZoraFactoryImpl.sol +115 -83
  29. package/src/hook-registry/ZoraHookRegistry.sol +4 -0
  30. package/src/hooks/ZoraV4CoinHook.sol +66 -9
  31. package/src/interfaces/IUpgradeableV4Hook.sol +18 -0
  32. package/src/interfaces/IZoraFactory.sol +21 -2
  33. package/src/libs/CoinConstants.sol +51 -8
  34. package/src/libs/CoinDopplerMultiCurve.sol +11 -11
  35. package/src/libs/CoinRewardsV4.sol +26 -33
  36. package/src/libs/CoinSetup.sol +2 -9
  37. package/src/libs/DopplerMath.sol +2 -2
  38. package/src/libs/V4Liquidity.sol +79 -15
  39. package/src/version/ContractVersionBase.sol +1 -1
  40. package/test/Coin.t.sol +5 -5
  41. package/test/CoinRewardsV4.t.sol +33 -0
  42. package/test/CoinUniV4.t.sol +2 -3
  43. package/test/ContentCoinRewards.t.sol +43 -0
  44. package/test/CreatorCoin.t.sol +53 -29
  45. package/test/DeploymentHooks.t.sol +54 -2
  46. package/test/LiquidityMigration.t.sol +145 -7
  47. package/test/V4Liquidity.t.sol +178 -0
  48. package/test/utils/BaseTest.sol +0 -1
  49. package/test/utils/RewardTestHelpers.sol +4 -4
  50. package/abis/CoinConstants.json +0 -54
  51. package/abis/CoinRewardsV4.json +0 -67
  52. package/src/libs/CreatorCoinConstants.sol +0 -15
  53. package/src/libs/MarketConstants.sol +0 -23
  54. /package/abis/{VmContractHelper227.json → VmContractHelper226.json} +0 -0
@@ -413,6 +413,75 @@
413
413
  ],
414
414
  "stateMutability": "nonpayable"
415
415
  },
416
+ {
417
+ "type": "function",
418
+ "name": "deployCreatorCoin",
419
+ "inputs": [
420
+ {
421
+ "name": "payoutRecipient",
422
+ "type": "address",
423
+ "internalType": "address"
424
+ },
425
+ {
426
+ "name": "owners",
427
+ "type": "address[]",
428
+ "internalType": "address[]"
429
+ },
430
+ {
431
+ "name": "uri",
432
+ "type": "string",
433
+ "internalType": "string"
434
+ },
435
+ {
436
+ "name": "name",
437
+ "type": "string",
438
+ "internalType": "string"
439
+ },
440
+ {
441
+ "name": "symbol",
442
+ "type": "string",
443
+ "internalType": "string"
444
+ },
445
+ {
446
+ "name": "poolConfig",
447
+ "type": "bytes",
448
+ "internalType": "bytes"
449
+ },
450
+ {
451
+ "name": "platformReferrer",
452
+ "type": "address",
453
+ "internalType": "address"
454
+ },
455
+ {
456
+ "name": "postDeployHook",
457
+ "type": "address",
458
+ "internalType": "address"
459
+ },
460
+ {
461
+ "name": "postDeployHookData",
462
+ "type": "bytes",
463
+ "internalType": "bytes"
464
+ },
465
+ {
466
+ "name": "coinSalt",
467
+ "type": "bytes32",
468
+ "internalType": "bytes32"
469
+ }
470
+ ],
471
+ "outputs": [
472
+ {
473
+ "name": "coin",
474
+ "type": "address",
475
+ "internalType": "address"
476
+ },
477
+ {
478
+ "name": "postDeployHookDataOut",
479
+ "type": "bytes",
480
+ "internalType": "bytes"
481
+ }
482
+ ],
483
+ "stateMutability": "payable"
484
+ },
416
485
  {
417
486
  "type": "function",
418
487
  "name": "deployWithHook",
@@ -1111,7 +1111,7 @@
1111
1111
  ]
1112
1112
  },
1113
1113
  {
1114
- "name": "",
1114
+ "name": "additionalData",
1115
1115
  "type": "bytes",
1116
1116
  "internalType": "bytes"
1117
1117
  }
@@ -1119,6 +1119,99 @@
1119
1119
  "outputs": [],
1120
1120
  "stateMutability": "nonpayable"
1121
1121
  },
1122
+ {
1123
+ "type": "function",
1124
+ "name": "initializeFromMigrationWithUpdateableFee",
1125
+ "inputs": [
1126
+ {
1127
+ "name": "poolKey",
1128
+ "type": "tuple",
1129
+ "internalType": "struct PoolKey",
1130
+ "components": [
1131
+ {
1132
+ "name": "currency0",
1133
+ "type": "address",
1134
+ "internalType": "Currency"
1135
+ },
1136
+ {
1137
+ "name": "currency1",
1138
+ "type": "address",
1139
+ "internalType": "Currency"
1140
+ },
1141
+ {
1142
+ "name": "fee",
1143
+ "type": "uint24",
1144
+ "internalType": "uint24"
1145
+ },
1146
+ {
1147
+ "name": "tickSpacing",
1148
+ "type": "int24",
1149
+ "internalType": "int24"
1150
+ },
1151
+ {
1152
+ "name": "hooks",
1153
+ "type": "address",
1154
+ "internalType": "contract IHooks"
1155
+ }
1156
+ ]
1157
+ },
1158
+ {
1159
+ "name": "coin",
1160
+ "type": "address",
1161
+ "internalType": "address"
1162
+ },
1163
+ {
1164
+ "name": "sqrtPriceX96",
1165
+ "type": "uint160",
1166
+ "internalType": "uint160"
1167
+ },
1168
+ {
1169
+ "name": "migratedLiquidity",
1170
+ "type": "tuple[]",
1171
+ "internalType": "struct BurnedPosition[]",
1172
+ "components": [
1173
+ {
1174
+ "name": "tickLower",
1175
+ "type": "int24",
1176
+ "internalType": "int24"
1177
+ },
1178
+ {
1179
+ "name": "tickUpper",
1180
+ "type": "int24",
1181
+ "internalType": "int24"
1182
+ },
1183
+ {
1184
+ "name": "amount0Received",
1185
+ "type": "uint128",
1186
+ "internalType": "uint128"
1187
+ },
1188
+ {
1189
+ "name": "amount1Received",
1190
+ "type": "uint128",
1191
+ "internalType": "uint128"
1192
+ }
1193
+ ]
1194
+ },
1195
+ {
1196
+ "name": "additionalData",
1197
+ "type": "bytes",
1198
+ "internalType": "bytes"
1199
+ }
1200
+ ],
1201
+ "outputs": [
1202
+ {
1203
+ "name": "fee",
1204
+ "type": "uint24",
1205
+ "internalType": "uint24"
1206
+ },
1207
+ {
1208
+ "name": "tickSpacing",
1209
+ "type": "int24",
1210
+ "internalType": "int24"
1211
+ }
1212
+ ],
1213
+ "stateMutability": "nonpayable"
1214
+ },
1122
1215
  {
1123
1216
  "type": "function",
1124
1217
  "name": "isTrustedMessageSender",
@@ -3,13 +3,13 @@
3
3
  "COIN_V3_IMPL": "0x45Bf86430af7CD071Ea23aE52325A78C8d12aD5a",
4
4
  "COIN_V4_IMPL": "0xca72309AaF706d290E08608b1Af47943902f69b2",
5
5
  "COIN_VERSION": "1.1.0",
6
- "CREATOR_COIN_HOOK": "0xd61A675F8a0c67A73DC3B54FB7318B4D91409040",
7
- "CREATOR_COIN_HOOK_SALT": "0x0000000000000000000000000000000000000000000000000000000000000ae8",
6
+ "CREATOR_COIN_HOOK": "0x1258e5f3C71ca9dCE95Ce734Ba5759532E46D040",
7
+ "CREATOR_COIN_HOOK_SALT": "0x00000000000000000000000000000000000000000000000000000000000029b1",
8
8
  "CREATOR_COIN_IMPL": "0x88CC4E08C7608723f3E44e17aC669Fb43b6A8313",
9
9
  "HOOK_UPGRADE_GATE": "0xD88f6BdD765313CaFA5888C177c325E2C3AbF2D2",
10
10
  "ZORA_FACTORY": "0x777777751622c0d3258f214F9DF38E35BF45baF3",
11
- "ZORA_FACTORY_IMPL": "0x0e2ea62E5377D46FeF114A60AfBE3d5eA7490577",
12
- "ZORA_V4_COIN_HOOK": "0x9ea932730A7787000042e34390B8E435dD839040",
13
- "ZORA_V4_COIN_HOOK_SALT": "0x0000000000000000000000000000000000000000000000000000000000002fa2",
14
- "ZORA_HOOK_REGISTRY": "0x777777C4c14b133858c3982D41Dbf02509fc18d7"
11
+ "ZORA_FACTORY_IMPL": "0x57e338b97757f6E416965BEB9A5Cd2DB48b10c42",
12
+ "ZORA_HOOK_REGISTRY": "0x777777C4c14b133858c3982D41Dbf02509fc18d7",
13
+ "ZORA_V4_COIN_HOOK": "0x2b15a16B3Ef024005bA899Bb51764FCd58Cf9040",
14
+ "ZORA_V4_COIN_HOOK_SALT": "0x0000000000000000000000000000000000000000000000000000000000000f90"
15
15
  }