@zoralabs/coins 0.9.0 → 1.0.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 (131) hide show
  1. package/.turbo/turbo-build.log +179 -114
  2. package/CHANGELOG.md +46 -0
  3. package/abis/BaseCoin.json +26 -118
  4. package/abis/BaseTest.json +47 -0
  5. package/abis/BuySupplyWithSwapRouterHook.json +40 -0
  6. package/abis/Coin.json +171 -63
  7. package/abis/CoinDopplerMultiCurve.json +38 -0
  8. package/abis/CoinRewardsV4.json +54 -0
  9. package/abis/CoinTest.json +53 -20
  10. package/abis/CoinUniV4Test.json +1091 -0
  11. package/abis/CoinV4.json +234 -211
  12. package/abis/DeployScript.json +47 -0
  13. package/abis/DeployedCoinVersionLookup.json +21 -0
  14. package/abis/DeployedCoinVersionLookupTest.json +716 -0
  15. package/abis/DifferentNamespaceVersionLookup.json +39 -0
  16. package/abis/DopplerUniswapV3Test.json +49 -93
  17. package/abis/ERC20.json +310 -0
  18. package/abis/FactoryTest.json +85 -7
  19. package/abis/FeeEstimatorHook.json +1515 -0
  20. package/abis/HooksDeployment.json +23 -0
  21. package/abis/HooksTest.json +60 -0
  22. package/abis/ICoin.json +40 -71
  23. package/abis/ICoinV3.json +879 -0
  24. package/abis/ICoinV4.json +915 -0
  25. package/abis/IDeployedCoinVersionLookup.json +21 -0
  26. package/abis/IERC721.json +36 -36
  27. package/abis/IHasPoolKey.json +42 -0
  28. package/abis/IHasRewardsRecipients.json +54 -0
  29. package/abis/IHasSwapPath.json +60 -0
  30. package/abis/IMsgSender.json +15 -0
  31. package/abis/IPoolConfigEncoding.json +46 -0
  32. package/abis/ISwapPathRouter.json +92 -0
  33. package/abis/IUniversalRouter.json +61 -0
  34. package/abis/IUnlockCallback.json +21 -0
  35. package/abis/IV4Quoter.json +310 -0
  36. package/abis/IZoraFactory.json +210 -11
  37. package/abis/IZoraV4CoinHook.json +348 -4
  38. package/abis/MockERC20.json +21 -0
  39. package/abis/MultiOwnableTest.json +47 -0
  40. package/abis/{CoinConfigurationVersions.json → Position.json} +1 -1
  41. package/abis/PrintUpgradeCommand.json +9 -0
  42. package/abis/ProxyShim.json +24 -0
  43. package/abis/StateLibrary.json +80 -0
  44. package/abis/TestDeployedCoinVersionLookupImplementation.json +39 -0
  45. package/abis/TestV4Swap.json +9 -0
  46. package/abis/UpgradeCoinImpl.json +47 -0
  47. package/abis/UpgradesTest.json +81 -0
  48. package/abis/Vm.json +1482 -111
  49. package/abis/VmSafe.json +856 -32
  50. package/abis/ZoraFactoryImpl.json +339 -1
  51. package/abis/ZoraV4CoinHook.json +442 -5
  52. package/addresses/8453.json +7 -4
  53. package/addresses/84532.json +8 -5
  54. package/addresses/dev/8453.json +10 -0
  55. package/dist/index.cjs +1932 -167
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.js +1928 -167
  58. package/dist/index.js.map +1 -1
  59. package/dist/wagmiGenerated.d.ts +2606 -160
  60. package/dist/wagmiGenerated.d.ts.map +1 -1
  61. package/foundry.toml +1 -0
  62. package/package/wagmiGenerated.ts +1941 -164
  63. package/package.json +8 -3
  64. package/remappings.txt +6 -1
  65. package/script/Deploy.s.sol +1 -1
  66. package/script/DeployDevFactory.s.sol +21 -0
  67. package/script/DeployHooks.s.sol +1 -1
  68. package/script/PrintUpgradeCommand.s.sol +13 -0
  69. package/script/Simulate.s.sol +1 -10
  70. package/script/TestBackingCoinSwap.s.sol +147 -0
  71. package/script/TestV4Swap.s.sol +136 -0
  72. package/script/UpgradeCoinImpl.sol +2 -2
  73. package/script/UpgradeFactoryImpl.s.sol +2 -2
  74. package/src/BaseCoin.sol +190 -0
  75. package/src/Coin.sol +87 -202
  76. package/src/CoinV4.sol +121 -0
  77. package/src/ZoraFactoryImpl.sol +208 -36
  78. package/{script → src/deployment}/CoinsDeployerBase.sol +111 -17
  79. package/src/hooks/ZoraV4CoinHook.sol +212 -0
  80. package/src/hooks/{BaseCoinDeployHook.sol → deployment/BaseCoinDeployHook.sol} +3 -3
  81. package/src/hooks/deployment/BuySupplyWithSwapRouterHook.sol +140 -0
  82. package/src/interfaces/ICoin.sol +31 -39
  83. package/src/interfaces/ICoinV3.sol +71 -0
  84. package/src/interfaces/ICoinV4.sol +69 -0
  85. package/src/interfaces/IDeployedCoinVersionLookup.sol +11 -0
  86. package/src/interfaces/IMsgSender.sol +9 -0
  87. package/src/interfaces/IPoolConfigEncoding.sol +14 -0
  88. package/src/interfaces/ISwapPathRouter.sol +14 -0
  89. package/src/interfaces/IZoraFactory.sol +67 -28
  90. package/src/interfaces/IZoraV4CoinHook.sol +116 -0
  91. package/src/libs/CoinCommon.sol +15 -0
  92. package/src/libs/CoinConfigurationVersions.sol +116 -1
  93. package/src/libs/CoinConstants.sol +5 -0
  94. package/src/libs/CoinDopplerMultiCurve.sol +134 -0
  95. package/src/libs/CoinDopplerUniV3.sol +19 -171
  96. package/src/libs/CoinRewards.sol +195 -0
  97. package/src/libs/CoinRewardsV4.sol +179 -0
  98. package/src/libs/CoinSetup.sol +57 -0
  99. package/src/libs/CoinSetupV3.sol +6 -67
  100. package/src/libs/DopplerMath.sol +156 -0
  101. package/src/libs/HooksDeployment.sol +128 -0
  102. package/src/libs/MarketConstants.sol +4 -0
  103. package/src/libs/PoolStateReader.sol +22 -0
  104. package/src/libs/UniV3BuySell.sol +74 -292
  105. package/src/libs/UniV4SwapHelper.sol +65 -0
  106. package/src/libs/UniV4SwapToCurrency.sol +109 -0
  107. package/src/libs/V4Liquidity.sol +122 -0
  108. package/src/types/PoolConfiguration.sol +15 -0
  109. package/src/utils/DeployedCoinVersionLookup.sol +52 -0
  110. package/src/version/ContractVersionBase.sol +1 -1
  111. package/test/Coin.t.sol +78 -88
  112. package/test/CoinDopplerUniV3.t.sol +32 -171
  113. package/test/CoinUniV4.t.sol +777 -0
  114. package/test/{Hooks.t.sol → DeploymentHooks.t.sol} +53 -16
  115. package/test/Factory.t.sol +80 -47
  116. package/test/MultiOwnable.t.sol +6 -3
  117. package/test/Upgrades.t.sol +97 -5
  118. package/test/mocks/MockERC20.sol +12 -0
  119. package/test/utils/BaseTest.sol +162 -57
  120. package/test/utils/DeployedCoinVersionLookup.t.sol +127 -0
  121. package/test/utils/FeeEstimatorHook.sol +84 -0
  122. package/test/utils/ProxyShim.sol +17 -0
  123. package/wagmi.config.ts +4 -0
  124. package/.env +0 -1
  125. package/.turbo/turbo-update-contract-version.log +0 -22
  126. package/abis/CoinSetupV3.json +0 -7
  127. package/abis/HookDeployer.json +0 -68
  128. package/abis/IHookDeployer.json +0 -42
  129. package/src/hooks/BuySupplyWithSwapRouterHook.sol +0 -78
  130. package/src/libs/CoinLegacy.sol +0 -48
  131. package/src/libs/CoinLegacyMarket.sol +0 -182
@@ -1,114 +1,179 @@
1
-
2
- 
3
- > @zoralabs/coins@0.9.0 build /Users/danovedzora/source/zora-protocol/packages/coins
4
- > pnpm run wagmi:generate && pnpm run copy-abis && pnpm run prettier:write && tsup
5
-
6
-
7
- > @zoralabs/coins@0.9.0 wagmi:generate /Users/danovedzora/source/zora-protocol/packages/coins
8
- > FOUNDRY_PROFILE=dev forge build && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts
9
-
10
- Warning: This is a nightly build of Foundry. It is recommended to use the latest stable version. Visit https://book.getfoundry.sh/announcements for more information.
11
- To mute this warning set `FOUNDRY_DISABLE_NIGHTLY_WARNING` in your environment.
12
-
13
-
14
-
15
-
16
- Compiler run successful with warnings:
17
- Warning (2072): Unused local variable.
18
- --> script/Simulate.s.sol:45:10:
19
-  |
20
- 45 | (address coinAddress, uint256 coinsPurchased) = factory.deploy{value: orderSize}(
21
-  | ^^^^^^^^^^^^^^^^^^^
22
-
23
- Warning (2072): Unused local variable.
24
- --> script/Simulate.s.sol:45:31:
25
-  |
26
- 45 | (address coinAddress, uint256 coinsPurchased) = factory.deploy{value: orderSize}(
27
-  | ^^^^^^^^^^^^^^^^^^^^^^
28
-
29
- [?25l⠋ Validating plugins✔ Validating plugins
30
- [?25h[?25l⠙ Resolving contracts✔ Resolving contracts
31
- [?25h[?25l⠹ Running plugins✔ Running plugins
32
- [?25h[?25l⠸ Writing to package/wagmiGenerated.ts[?25l⠼ Writing to package/wagmiGenerated.ts✔ Writing to package/wagmiGenerated.ts
33
- [?25h🔄 Processing 1 file(s) to replace 'Abi' with 'ABI'...
34
- 📝 Processing ./package/wagmiGenerated.ts...
35
- ✅ Updated ./package/wagmiGenerated.ts (4 replacements)
36
- All files processed successfully!
37
-
38
- > @zoralabs/coins@0.9.0 copy-abis /Users/danovedzora/source/zora-protocol/packages/coins
39
- > pnpm exec bundle-abis
40
-
41
-
42
- > @zoralabs/coins@0.9.0 prettier:write /Users/danovedzora/source/zora-protocol/packages/coins
43
- > prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
44
-
45
- src/Coin.solsrc/Coin.sol 141ms (unchanged)
46
- src/hooks/BaseCoinDeployHook.solsrc/hooks/BaseCoinDeployHook.sol 17ms (unchanged)
47
- src/hooks/BuySupplyWithSwapRouterHook.solsrc/hooks/BuySupplyWithSwapRouterHook.sol 36ms (unchanged)
48
- src/interfaces/IAirlock.solsrc/interfaces/IAirlock.sol 3ms (unchanged)
49
- src/interfaces/ICoin.solsrc/interfaces/ICoin.sol 8ms (unchanged)
50
- src/interfaces/ICoinComments.solsrc/interfaces/ICoinComments.sol 1ms (unchanged)
51
- src/interfaces/ICoinDeployHook.solsrc/interfaces/ICoinDeployHook.sol 1ms (unchanged)
52
- src/interfaces/IDopplerErrors.solsrc/interfaces/IDopplerErrors.sol 1ms (unchanged)
53
- src/interfaces/IERC7572.solsrc/interfaces/IERC7572.sol 1ms (unchanged)
54
- src/interfaces/INonfungiblePositionManager.solsrc/interfaces/INonfungiblePositionManager.sol 5ms (unchanged)
55
- src/interfaces/IProtocolRewards.solsrc/interfaces/IProtocolRewards.sol 2ms (unchanged)
56
- src/interfaces/ISwapRouter.solsrc/interfaces/ISwapRouter.sol 0ms (unchanged)
57
- src/interfaces/IUniswapV3Factory.solsrc/interfaces/IUniswapV3Factory.sol 3ms (unchanged)
58
- src/interfaces/IUniswapV3Pool.solsrc/interfaces/IUniswapV3Pool.sol 3ms (unchanged)
59
- src/interfaces/IUniswapV3SwapCallback.solsrc/interfaces/IUniswapV3SwapCallback.sol 0ms (unchanged)
60
- src/interfaces/IWETH.solsrc/interfaces/IWETH.sol 2ms (unchanged)
61
- src/interfaces/IZoraFactory.solsrc/interfaces/IZoraFactory.sol 3ms (unchanged)
62
- src/libs/CoinConfigurationVersions.solsrc/libs/CoinConfigurationVersions.sol 1ms (unchanged)
63
- src/libs/CoinConstants.solsrc/libs/CoinConstants.sol 2ms (unchanged)
64
- src/libs/CoinDopplerUniV3.solsrc/libs/CoinDopplerUniV3.sol 87ms (unchanged)
65
- src/libs/CoinLegacy.solsrc/libs/CoinLegacy.sol 18ms (unchanged)
66
- src/libs/CoinLegacyMarket.solsrc/libs/CoinLegacyMarket.sol 49ms (unchanged)
67
- src/libs/CoinSetupV3.solsrc/libs/CoinSetupV3.sol 27ms (unchanged)
68
- src/libs/MarketConstants.solsrc/libs/MarketConstants.sol 0ms (unchanged)
69
- src/libs/UniV3BuySell.solsrc/libs/UniV3BuySell.sol 156ms (unchanged)
70
- src/libs/UniV3Errors.solsrc/libs/UniV3Errors.sol 1ms (unchanged)
71
- src/proxy/ZoraFactory.solsrc/proxy/ZoraFactory.sol 5ms (unchanged)
72
- src/types/LpPosition.solsrc/types/LpPosition.sol 1ms (unchanged)
73
- src/types/PoolState.solsrc/types/PoolState.sol 1ms (unchanged)
74
- src/utils/MultiOwnable.solsrc/utils/MultiOwnable.sol 26ms (unchanged)
75
- src/utils/uniswap/BitMath.solsrc/utils/uniswap/BitMath.sol 5ms (unchanged)
76
- src/utils/uniswap/CustomRevert.solsrc/utils/uniswap/CustomRevert.sol 18ms (unchanged)
77
- src/utils/uniswap/FixedPoint96.solsrc/utils/uniswap/FixedPoint96.sol 1ms (unchanged)
78
- src/utils/uniswap/FullMath.solsrc/utils/uniswap/FullMath.sol 14ms (unchanged)
79
- src/utils/uniswap/LiquidityAmounts.solsrc/utils/uniswap/LiquidityAmounts.sol 26ms (unchanged)
80
- src/utils/uniswap/SafeCast.solsrc/utils/uniswap/SafeCast.sol 20ms (unchanged)
81
- src/utils/uniswap/SqrtPriceMath.solsrc/utils/uniswap/SqrtPriceMath.sol 40ms (unchanged)
82
- src/utils/uniswap/TickMath.solsrc/utils/uniswap/TickMath.sol 37ms (unchanged)
83
- src/utils/uniswap/UnsafeMath.solsrc/utils/uniswap/UnsafeMath.sol 2ms (unchanged)
84
- src/version/ContractVersionBase.solsrc/version/ContractVersionBase.sol 1ms (unchanged)
85
- src/ZoraFactoryImpl.solsrc/ZoraFactoryImpl.sol 54ms (unchanged)
86
- test/Coin.t.soltest/Coin.t.sol 188ms (unchanged)
87
- test/CoinDopplerUniV3.t.soltest/CoinDopplerUniV3.t.sol 135ms (unchanged)
88
- test/Factory.t.soltest/Factory.t.sol 87ms (unchanged)
89
- test/Hooks.t.soltest/Hooks.t.sol 55ms (unchanged)
90
- test/MultiOwnable.t.soltest/MultiOwnable.t.sol 46ms (unchanged)
91
- test/Upgrades.t.soltest/Upgrades.t.sol 11ms (unchanged)
92
- test/utils/BaseTest.soltest/utils/BaseTest.sol 53ms (unchanged)
93
- test/utils/ProtocolRewards.soltest/utils/ProtocolRewards.sol 171ms (unchanged)
94
- script/CoinsDeployerBase.solscript/CoinsDeployerBase.sol 45ms (unchanged)
95
- script/Deploy.s.solscript/Deploy.s.sol 3ms (unchanged)
96
- script/DeployHooks.s.solscript/DeployHooks.s.sol 2ms (unchanged)
97
- script/GenerateDeterministicParams.s.solscript/GenerateDeterministicParams.s.sol 7ms (unchanged)
98
- script/Simulate.s.solscript/Simulate.s.sol 7ms (unchanged)
99
- script/UpgradeCoinImpl.solscript/UpgradeCoinImpl.sol 3ms (unchanged)
100
- script/UpgradeFactoryImpl.s.solscript/UpgradeFactoryImpl.s.sol 2ms (unchanged)
101
- CLI Building entry: package/index.ts
102
- CLI Using tsconfig: tsconfig.json
103
- CLI tsup v8.4.0
104
- CLI Using tsup config: /Users/danovedzora/source/zora-protocol/packages/coins/tsup.config.ts
105
- CLI Target: es2021
106
- CLI Cleaning output folder
107
- CJS Build start
108
- ESM Build start
109
- ESM dist/index.js 39.96 KB
110
- ESM dist/index.js.map 72.99 KB
111
- ESM ⚡️ Build success in 9ms
112
- CJS dist/index.cjs 41.12 KB
113
- CJS dist/index.cjs.map 73.11 KB
114
- CJS ⚡️ Build success in 10ms
1
+
2
+ > @zoralabs/coins@1.0.1 build /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
3
+ > pnpm run wagmi:generate && pnpm run copy-abis && pnpm run prettier:write && tsup
4
+
5
+
6
+ > @zoralabs/coins@1.0.1 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
7
+ > FOUNDRY_PROFILE=dev forge build && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts
8
+
9
+ Compiling 217 files with Solc 0.8.28
10
+ Solc 0.8.28 finished in 168.87s
11
+ Compiler run successful with warnings:
12
+ Warning (6321): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
13
+ --> src/hooks/ZoraV4CoinHook.sol:194:84:
14
+ |
15
+ 194 | function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) {
16
+ | ^^^^^^^^^^^^
17
+
18
+ Warning (2072): Unused local variable.
19
+ --> src/libs/HooksDeployment.sol:35:9:
20
+ |
21
+ 35 | bytes32 creationCodeHash = keccak256(creationCodeWithArgs);
22
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
23
+
24
+ Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
25
+ --> src/deployment/CoinsDeployerBase.sol:194:84:
26
+ |
27
+ 194 | function deployDevFactory(CoinsDeployment memory deployment) internal returns (ZoraFactory devFactory) {
28
+ | ^^^^^^^^^^^^^^^^^^^^^^
29
+
30
+ Warning (2072): Unused local variable.
31
+ --> script/TestBackingCoinSwap.s.sol:107:9:
32
+ |
33
+ 107 | address tradeReferral = 0xC077e4cC02fa01A5b7fAca1acE9BBe9f5ac5Af9F;
34
+ | ^^^^^^^^^^^^^^^^^^^^^
35
+
36
+ Warning (2072): Unused local variable.
37
+ --> script/TestV4Swap.s.sol:99:9:
38
+ |
39
+ 99 | address createReferral = 0xC077e4cC02fa01A5b7fAca1acE9BBe9f5ac5Af9F;
40
+ | ^^^^^^^^^^^^^^^^^^^^^^
41
+
42
+ Warning (2072): Unused local variable.
43
+ --> test/Upgrades.t.sol:140:9:
44
+ |
45
+ 140 | bytes[] memory inputs = new bytes[](5);
46
+ | ^^^^^^^^^^^^^^^^^^^^^
47
+
48
+ Warning (2072): Unused local variable.
49
+ --> test/Upgrades.t.sol:148:9:
50
+ |
51
+ 148 | PoolKey memory key = coin.getPoolKey();
52
+ | ^^^^^^^^^^^^^^^^^^
53
+
54
+ Warning (2018): Function state mutability can be restricted to pure
55
+ --> src/libs/HooksDeployment.sol:20:5:
56
+ |
57
+ 20 | function deterministicHookAddress(address deployer, bytes32 salt, bytes memory creationCode) internal view returns (address) {
58
+ | ^ (Relevant source part starts here and spans across multiple lines).
59
+
60
+ - Validating plugins
61
+ ✔ Validating plugins
62
+ - Resolving contracts
63
+ ✔ Resolving contracts
64
+ - Running plugins
65
+ ✔ Running plugins
66
+ - Writing to package/wagmiGenerated.ts
67
+ ✔ Writing to package/wagmiGenerated.ts
68
+ 🔄 Processing 1 file(s) to replace 'Abi' with 'ABI'...
69
+ 📝 Processing ./package/wagmiGenerated.ts...
70
+ ✅ Updated ./package/wagmiGenerated.ts (8 replacements)
71
+ All files processed successfully!
72
+
73
+ > @zoralabs/coins@1.0.1 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
74
+ > pnpm exec bundle-abis
75
+
76
+
77
+ > @zoralabs/coins@1.0.1 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
78
+ > prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
79
+
80
+ src/BaseCoin.sol 337ms (unchanged)
81
+ src/Coin.sol 134ms (unchanged)
82
+ src/CoinV4.sol 94ms (unchanged)
83
+ src/deployment/CoinsDeployerBase.sol 171ms (unchanged)
84
+ src/hooks/deployment/BaseCoinDeployHook.sol 16ms (unchanged)
85
+ src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 147ms (unchanged)
86
+ src/hooks/ZoraV4CoinHook.sol 89ms (unchanged)
87
+ src/interfaces/IAirlock.sol 1ms (unchanged)
88
+ src/interfaces/ICoin.sol 10ms (unchanged)
89
+ src/interfaces/ICoinComments.sol 4ms (unchanged)
90
+ src/interfaces/ICoinDeployHook.sol 1ms (unchanged)
91
+ src/interfaces/ICoinV3.sol 3ms (unchanged)
92
+ src/interfaces/ICoinV4.sol 2ms (unchanged)
93
+ src/interfaces/IDeployedCoinVersionLookup.sol 1ms (unchanged)
94
+ src/interfaces/IDopplerErrors.sol 1ms (unchanged)
95
+ src/interfaces/IERC7572.sol 1ms (unchanged)
96
+ src/interfaces/IMsgSender.sol 0ms (unchanged)
97
+ src/interfaces/INonfungiblePositionManager.sol 4ms (unchanged)
98
+ src/interfaces/IPoolConfigEncoding.sol 1ms (unchanged)
99
+ src/interfaces/IProtocolRewards.sol 2ms (unchanged)
100
+ src/interfaces/ISwapPathRouter.sol 1ms (unchanged)
101
+ src/interfaces/ISwapRouter.sol 0ms (unchanged)
102
+ src/interfaces/IUniswapV3Factory.sol 3ms (unchanged)
103
+ src/interfaces/IUniswapV3Pool.sol 3ms (unchanged)
104
+ src/interfaces/IUniswapV3SwapCallback.sol 1ms (unchanged)
105
+ src/interfaces/IWETH.sol 2ms (unchanged)
106
+ src/interfaces/IZoraFactory.sol 10ms (unchanged)
107
+ src/interfaces/IZoraV4CoinHook.sol 6ms (unchanged)
108
+ src/libs/CoinCommon.sol 4ms (unchanged)
109
+ src/libs/CoinConfigurationVersions.sol 51ms (unchanged)
110
+ src/libs/CoinConstants.sol 5ms (unchanged)
111
+ src/libs/CoinDopplerMultiCurve.sol 126ms (unchanged)
112
+ src/libs/CoinDopplerUniV3.sol 28ms (unchanged)
113
+ src/libs/CoinRewards.sol 102ms (unchanged)
114
+ src/libs/CoinRewardsV4.sol 62ms (unchanged)
115
+ src/libs/CoinSetup.sol 20ms (unchanged)
116
+ src/libs/CoinSetupV3.sol 13ms (unchanged)
117
+ src/libs/DopplerMath.sol 93ms (unchanged)
118
+ src/libs/HooksDeployment.sol 47ms (unchanged)
119
+ src/libs/MarketConstants.sol 1ms (unchanged)
120
+ src/libs/PoolStateReader.sol 3ms (unchanged)
121
+ src/libs/UniV3BuySell.sol 77ms (unchanged)
122
+ src/libs/UniV3Errors.sol 1ms (unchanged)
123
+ src/libs/UniV4SwapHelper.sol 25ms (unchanged)
124
+ src/libs/UniV4SwapToCurrency.sol 45ms (unchanged)
125
+ src/libs/V4Liquidity.sol 53ms (unchanged)
126
+ src/proxy/ZoraFactory.sol 6ms (unchanged)
127
+ src/types/LpPosition.sol 1ms (unchanged)
128
+ src/types/PoolConfiguration.sol 1ms (unchanged)
129
+ src/types/PoolState.sol 2ms (unchanged)
130
+ src/utils/DeployedCoinVersionLookup.sol 7ms (unchanged)
131
+ src/utils/MultiOwnable.sol 47ms (unchanged)
132
+ src/utils/uniswap/BitMath.sol 7ms (unchanged)
133
+ src/utils/uniswap/CustomRevert.sol 50ms (unchanged)
134
+ src/utils/uniswap/FixedPoint96.sol 1ms (unchanged)
135
+ src/utils/uniswap/FullMath.sol 20ms (unchanged)
136
+ src/utils/uniswap/LiquidityAmounts.sol 39ms (unchanged)
137
+ src/utils/uniswap/SafeCast.sol 13ms (unchanged)
138
+ src/utils/uniswap/SqrtPriceMath.sol 64ms (unchanged)
139
+ src/utils/uniswap/TickMath.sol 65ms (unchanged)
140
+ src/utils/uniswap/UnsafeMath.sol 2ms (unchanged)
141
+ src/version/ContractVersionBase.sol 1ms (unchanged)
142
+ src/ZoraFactoryImpl.sol 122ms (unchanged)
143
+ test/Coin.t.sol 292ms (unchanged)
144
+ test/CoinDopplerUniV3.t.sol 107ms (unchanged)
145
+ test/CoinUniV4.t.sol 320ms (unchanged)
146
+ test/DeploymentHooks.t.sol 100ms (unchanged)
147
+ test/Factory.t.sol 159ms (unchanged)
148
+ test/mocks/MockERC20.sol 2ms (unchanged)
149
+ test/MultiOwnable.t.sol 76ms (unchanged)
150
+ test/Upgrades.t.sol 44ms (unchanged)
151
+ test/utils/BaseTest.sol 116ms (unchanged)
152
+ test/utils/DeployedCoinVersionLookup.t.sol 36ms (unchanged)
153
+ test/utils/FeeEstimatorHook.sol 22ms (unchanged)
154
+ test/utils/ProtocolRewards.sol 274ms (unchanged)
155
+ test/utils/ProxyShim.sol 6ms (unchanged)
156
+ script/Deploy.s.sol 3ms (unchanged)
157
+ script/DeployDevFactory.s.sol 3ms (unchanged)
158
+ script/DeployHooks.s.sol 3ms (unchanged)
159
+ script/GenerateDeterministicParams.s.sol 10ms (unchanged)
160
+ script/PrintUpgradeCommand.s.sol 2ms (unchanged)
161
+ script/Simulate.s.sol 12ms (unchanged)
162
+ script/TestBackingCoinSwap.s.sol 30ms (unchanged)
163
+ script/TestV4Swap.s.sol 37ms (unchanged)
164
+ script/UpgradeCoinImpl.sol 4ms (unchanged)
165
+ script/UpgradeFactoryImpl.s.sol 5ms (unchanged)
166
+ CLI Building entry: package/index.ts
167
+ CLI Using tsconfig: tsconfig.json
168
+ CLI tsup v8.4.0
169
+ CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins/tsup.config.ts
170
+ CLI Target: es2021
171
+ CLI Cleaning output folder
172
+ CJS Build start
173
+ ESM Build start
174
+ ESM dist/index.js 88.73 KB
175
+ ESM dist/index.js.map 159.49 KB
176
+ ESM ⚡️ Build success in 33ms
177
+ CJS dist/index.cjs 90.06 KB
178
+ CJS dist/index.cjs.map 159.63 KB
179
+ CJS ⚡️ Build success in 34ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @zoralabs/coins
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 8cd56863: BuySupplyWithSwapRouterHook supports v4 coins
8
+
9
+ ## 1.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - 73e95f69: Upgraded coins to use Uniswap V4:
14
+
15
+ **New CoinV4 Implementation:**
16
+
17
+ - Migrated from Uniswap V3 to Uniswap V4, with logic moved into a hook.
18
+ - Automatic LP fee collection and multi-hop reward distribution on every swap
19
+ - New `ZoraV4CoinHook` handles afterSwap operations
20
+ - Support for complex multi-position liquidity curves and discovery positions
21
+ - Multi-hop fee swapping through intermediate currencies (e.g., ContentCoin → BackingCoin → Zora)
22
+
23
+ **Factory Updates:**
24
+
25
+ - Updated `deploy()` function signature with new `poolConfig`, `message`, and `salt` parameters
26
+ - Automatic V3/V4 version selection based on pool configuration
27
+ - Deterministic coin deployment with salt support
28
+ - New `CoinCreatedV4` event for V4 coin deployments
29
+
30
+ **Reward System Changes:**
31
+
32
+ - Increased trade referral rewards from 10% to 15% (1500 basis points)
33
+ - Automatic reward distribution in single backing currency
34
+
35
+ **New Interfaces and Events:**
36
+
37
+ - Added `IHasPoolKey` and `IHasSwapPath` interfaces for V4 functionality
38
+ - New `Swapped` event with detailed swap and price information
39
+ - New `CoinMarketRewardsV4` event for reward distribution tracking
40
+
41
+ **Breaking Changes:**
42
+
43
+ - New deterministic factory deploy function with salt
44
+
45
+ ### Patch Changes
46
+
47
+ - 6b8bdd9d: Remove ability to create coin with legacy pool config
48
+
3
49
  ## 0.9.0
4
50
 
5
51
  ### Minor Changes
@@ -1,8 +1,4 @@
1
1
  [
2
- {
3
- "type": "receive",
4
- "stateMutability": "payable"
5
- },
6
2
  {
7
3
  "type": "function",
8
4
  "name": "DOMAIN_SEPARATOR",
@@ -16,19 +12,6 @@
16
12
  ],
17
13
  "stateMutability": "view"
18
14
  },
19
- {
20
- "type": "function",
21
- "name": "WETH",
22
- "inputs": [],
23
- "outputs": [
24
- {
25
- "name": "",
26
- "type": "address",
27
- "internalType": "address"
28
- }
29
- ],
30
- "stateMutability": "view"
31
- },
32
15
  {
33
16
  "type": "function",
34
17
  "name": "addOwner",
@@ -55,6 +38,19 @@
55
38
  "outputs": [],
56
39
  "stateMutability": "nonpayable"
57
40
  },
41
+ {
42
+ "type": "function",
43
+ "name": "airlock",
44
+ "inputs": [],
45
+ "outputs": [
46
+ {
47
+ "name": "",
48
+ "type": "address",
49
+ "internalType": "address"
50
+ }
51
+ ],
52
+ "stateMutability": "view"
53
+ },
58
54
  {
59
55
  "type": "function",
60
56
  "name": "allowance",
@@ -135,63 +131,6 @@
135
131
  "outputs": [],
136
132
  "stateMutability": "nonpayable"
137
133
  },
138
- {
139
- "type": "function",
140
- "name": "buy",
141
- "inputs": [
142
- {
143
- "name": "recipient",
144
- "type": "address",
145
- "internalType": "address"
146
- },
147
- {
148
- "name": "orderSize",
149
- "type": "uint256",
150
- "internalType": "uint256"
151
- },
152
- {
153
- "name": "minAmountOut",
154
- "type": "uint256",
155
- "internalType": "uint256"
156
- },
157
- {
158
- "name": "sqrtPriceLimitX96",
159
- "type": "uint160",
160
- "internalType": "uint160"
161
- },
162
- {
163
- "name": "tradeReferrer",
164
- "type": "address",
165
- "internalType": "address"
166
- }
167
- ],
168
- "outputs": [
169
- {
170
- "name": "",
171
- "type": "uint256",
172
- "internalType": "uint256"
173
- },
174
- {
175
- "name": "",
176
- "type": "uint256",
177
- "internalType": "uint256"
178
- }
179
- ],
180
- "stateMutability": "payable"
181
- },
182
- {
183
- "type": "function",
184
- "name": "claimSecondaryRewards",
185
- "inputs": [
186
- {
187
- "name": "pushEthRewards",
188
- "type": "bool",
189
- "internalType": "bool"
190
- }
191
- ],
192
- "outputs": [],
193
- "stateMutability": "nonpayable"
194
- },
195
134
  {
196
135
  "type": "function",
197
136
  "name": "contractURI",
@@ -244,6 +183,19 @@
244
183
  ],
245
184
  "stateMutability": "view"
246
185
  },
186
+ {
187
+ "type": "function",
188
+ "name": "dopplerFeeRecipient",
189
+ "inputs": [],
190
+ "outputs": [
191
+ {
192
+ "name": "",
193
+ "type": "address",
194
+ "internalType": "address"
195
+ }
196
+ ],
197
+ "stateMutability": "view"
198
+ },
247
199
  {
248
200
  "type": "function",
249
201
  "name": "eip712Domain",
@@ -479,50 +431,6 @@
479
431
  "outputs": [],
480
432
  "stateMutability": "nonpayable"
481
433
  },
482
- {
483
- "type": "function",
484
- "name": "sell",
485
- "inputs": [
486
- {
487
- "name": "recipient",
488
- "type": "address",
489
- "internalType": "address"
490
- },
491
- {
492
- "name": "orderSize",
493
- "type": "uint256",
494
- "internalType": "uint256"
495
- },
496
- {
497
- "name": "minAmountOut",
498
- "type": "uint256",
499
- "internalType": "uint256"
500
- },
501
- {
502
- "name": "sqrtPriceLimitX96",
503
- "type": "uint160",
504
- "internalType": "uint160"
505
- },
506
- {
507
- "name": "tradeReferrer",
508
- "type": "address",
509
- "internalType": "address"
510
- }
511
- ],
512
- "outputs": [
513
- {
514
- "name": "",
515
- "type": "uint256",
516
- "internalType": "uint256"
517
- },
518
- {
519
- "name": "",
520
- "type": "uint256",
521
- "internalType": "uint256"
522
- }
523
- ],
524
- "stateMutability": "nonpayable"
525
- },
526
434
  {
527
435
  "type": "function",
528
436
  "name": "setContractURI",
@@ -586,5 +586,52 @@
586
586
  }
587
587
  ],
588
588
  "anonymous": false
589
+ },
590
+ {
591
+ "type": "error",
592
+ "name": "Create2EmptyBytecode",
593
+ "inputs": []
594
+ },
595
+ {
596
+ "type": "error",
597
+ "name": "Create2FailedDeployment",
598
+ "inputs": []
599
+ },
600
+ {
601
+ "type": "error",
602
+ "name": "Create2InsufficientBalance",
603
+ "inputs": [
604
+ {
605
+ "name": "balance",
606
+ "type": "uint256",
607
+ "internalType": "uint256"
608
+ },
609
+ {
610
+ "name": "needed",
611
+ "type": "uint256",
612
+ "internalType": "uint256"
613
+ }
614
+ ]
615
+ },
616
+ {
617
+ "type": "error",
618
+ "name": "HookNotDeployed",
619
+ "inputs": []
620
+ },
621
+ {
622
+ "type": "error",
623
+ "name": "InvalidHookAddress",
624
+ "inputs": [
625
+ {
626
+ "name": "expected",
627
+ "type": "address",
628
+ "internalType": "address"
629
+ },
630
+ {
631
+ "name": "actual",
632
+ "type": "address",
633
+ "internalType": "address"
634
+ }
635
+ ]
589
636
  }
590
637
  ]
@@ -11,6 +11,11 @@
11
11
  "name": "_swapRouter",
12
12
  "type": "address",
13
13
  "internalType": "address"
14
+ },
15
+ {
16
+ "name": "_poolManager",
17
+ "type": "address",
18
+ "internalType": "address"
14
19
  }
15
20
  ],
16
21
  "stateMutability": "nonpayable"
@@ -76,6 +81,25 @@
76
81
  ],
77
82
  "stateMutability": "pure"
78
83
  },
84
+ {
85
+ "type": "function",
86
+ "name": "unlockCallback",
87
+ "inputs": [
88
+ {
89
+ "name": "data",
90
+ "type": "bytes",
91
+ "internalType": "bytes"
92
+ }
93
+ ],
94
+ "outputs": [
95
+ {
96
+ "name": "",
97
+ "type": "bytes",
98
+ "internalType": "bytes"
99
+ }
100
+ ],
101
+ "stateMutability": "nonpayable"
102
+ },
79
103
  {
80
104
  "type": "error",
81
105
  "name": "AddressZero",
@@ -92,6 +116,17 @@
92
116
  }
93
117
  ]
94
118
  },
119
+ {
120
+ "type": "error",
121
+ "name": "CurrencyBalanceNot0",
122
+ "inputs": [
123
+ {
124
+ "name": "balance",
125
+ "type": "uint256",
126
+ "internalType": "uint256"
127
+ }
128
+ ]
129
+ },
95
130
  {
96
131
  "type": "error",
97
132
  "name": "Erc20NotReceived",
@@ -112,6 +147,11 @@
112
147
  "name": "NotFactory",
113
148
  "inputs": []
114
149
  },
150
+ {
151
+ "type": "error",
152
+ "name": "OnlyPoolManager",
153
+ "inputs": []
154
+ },
115
155
  {
116
156
  "type": "error",
117
157
  "name": "SwapReverted",