@zoralabs/coins 2.3.1 → 2.4.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 (126) hide show
  1. package/.turbo/turbo-build$colon$js.log +119 -128
  2. package/CHANGELOG.md +30 -0
  3. package/abis/Address.json +0 -16
  4. package/abis/BuySupplyWithSwapRouterHook.json +0 -27
  5. package/abis/BuySupplyWithV4SwapHook.json +0 -32
  6. package/abis/Clones.json +1 -1
  7. package/abis/CoinDopplerMultiCurve.json +109 -0
  8. package/abis/Create2.json +0 -21
  9. package/abis/ERC1967Proxy.json +1 -1
  10. package/abis/ERC1967Utils.json +0 -45
  11. package/abis/{UpgradeCoinImpl.json → Errors.json} +14 -10
  12. package/abis/{MockERC20.json → IERC1363.json} +134 -104
  13. package/abis/IERC1967.json +47 -0
  14. package/abis/IERC20.json +0 -36
  15. package/abis/IProtocolRewards.json +0 -258
  16. package/abis/{Script.json → ISupportsLimitOrderFill.json} +2 -2
  17. package/abis/ITrustedMsgSenderProviderLookup.json +21 -0
  18. package/abis/IZoraLimitOrderBookCoinsInterface.json +67 -0
  19. package/abis/IZoraV4CoinHook.json +15 -0
  20. package/abis/ProxyShim.json +15 -16
  21. package/abis/SafeCast.json +51 -0
  22. package/abis/{AddressConstants.json → SafeCast160.json} +1 -1
  23. package/abis/Strings.json +10 -0
  24. package/abis/TrustedMsgSenderProviderLookup.json +215 -0
  25. package/abis/UUPSUpgradeable.json +1 -1
  26. package/abis/V3ToV4SwapLib.json +28 -0
  27. package/abis/ZoraFactory.json +1 -1
  28. package/abis/ZoraFactoryImpl.json +22 -6
  29. package/abis/ZoraV4CoinHook.json +41 -51
  30. package/dist/index.cjs +950 -43
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.js +948 -41
  33. package/dist/index.js.map +1 -1
  34. package/dist/wagmiGenerated.d.ts +1459 -76
  35. package/dist/wagmiGenerated.d.ts.map +1 -1
  36. package/foundry.toml +5 -1
  37. package/package/wagmiGenerated.ts +951 -44
  38. package/package.json +7 -7
  39. package/remappings.txt +2 -1
  40. package/src/ZoraFactoryImpl.sol +8 -0
  41. package/src/deployment/ForkedCoinsAddresses.sol +54 -0
  42. package/src/hooks/ZoraV4CoinHook.sol +92 -74
  43. package/src/hooks/deployment/BuySupplyWithV4SwapHook.sol +20 -142
  44. package/src/interfaces/ISupportsLimitOrderFill.sol +11 -0
  45. package/src/interfaces/ITrustedMsgSenderProviderLookup.sol +18 -0
  46. package/src/interfaces/IZoraLimitOrderBookCoinsInterface.sol +21 -0
  47. package/src/interfaces/IZoraV4CoinHook.sol +9 -0
  48. package/src/libs/CoinConstants.sol +6 -0
  49. package/src/libs/CoinDopplerMultiCurve.sol +1 -1
  50. package/src/libs/CoinRewardsV4.sol +0 -1
  51. package/src/libs/HooksDeployment.sol +25 -12
  52. package/src/libs/UniV4SwapHelper.sol +35 -0
  53. package/src/libs/V3ToV4SwapLib.sol +261 -0
  54. package/src/libs/V4Liquidity.sol +50 -6
  55. package/src/utils/TrustedMsgSenderProviderLookup.sol +73 -0
  56. package/src/version/ContractVersionBase.sol +1 -1
  57. package/test/BuySupplyWithV4SwapHook.t.sol +4 -3
  58. package/test/Coin.t.sol +7 -1
  59. package/test/CoinUniV4.t.sol +2 -1
  60. package/test/ContentCoinRewards.t.sol +5 -1
  61. package/test/CreatorCoin.t.sol +3 -1
  62. package/test/CreatorCoinRewards.t.sol +7 -1
  63. package/test/Factory.t.sol +20 -7
  64. package/test/HooksDeployment.t.sol +73 -8
  65. package/test/LiquidityMigration.t.sol +55 -43
  66. package/test/MultiOwnable.t.sol +2 -1
  67. package/test/TrustedMsgSenderProviderLookup.t.sol +112 -0
  68. package/test/Upgrades.t.sol +112 -78
  69. package/test/V4Liquidity.t.sol +1 -1
  70. package/test/mocks/MockSwapRouter.sol +33 -0
  71. package/test/mocks/MockZoraLimitOrderBook.sol +14 -0
  72. package/test/utils/BaseTest.sol +17 -425
  73. package/test/utils/FeeEstimatorHook.sol +8 -2
  74. package/test/utils/TrustedSenderTestHelper.sol +18 -0
  75. package/test/utils/V4TestSetup.sol +595 -0
  76. package/wagmi.config.ts +1 -1
  77. package/abis/BaseTest.json +0 -718
  78. package/abis/DeterministicDeployerAndCaller.json +0 -315
  79. package/abis/DeterministicUUPSProxyDeployer.json +0 -167
  80. package/abis/EIP712.json +0 -67
  81. package/abis/ERC20.json +0 -310
  82. package/abis/FeeEstimatorHook.json +0 -1915
  83. package/abis/IERC721.json +0 -287
  84. package/abis/IERC721Enumerable.json +0 -343
  85. package/abis/IERC721Metadata.json +0 -332
  86. package/abis/IERC721TokenReceiver.json +0 -36
  87. package/abis/IImmutableCreate2Factory.json +0 -93
  88. package/abis/IMulticall3.json +0 -440
  89. package/abis/ISafe.json +0 -15
  90. package/abis/ISymbol.json +0 -15
  91. package/abis/IUniswapV4Router04.json +0 -484
  92. package/abis/IUniversalRouter.json +0 -61
  93. package/abis/IV4Quoter.json +0 -310
  94. package/abis/ImmutableCreate2FactoryUtils.json +0 -15
  95. package/abis/LibString.json +0 -7
  96. package/abis/Math.json +0 -7
  97. package/abis/MockAirlock.json +0 -39
  98. package/abis/MockERC721.json +0 -350
  99. package/abis/ProtocolRewards.json +0 -494
  100. package/abis/ShortStrings.json +0 -18
  101. package/abis/SimpleERC20.json +0 -326
  102. package/abis/StdAssertions.json +0 -379
  103. package/abis/StdInvariant.json +0 -180
  104. package/abis/Test.json +0 -570
  105. package/abis/VmContractHelper239.json +0 -233
  106. package/abis/stdError.json +0 -119
  107. package/abis/stdStorageSafe.json +0 -52
  108. package/addresses/8453.json +0 -13
  109. package/addresses/84532.json +0 -10
  110. package/deterministicConfig/deployerAndCaller.json +0 -5
  111. package/deterministicConfig/zoraFactory.json +0 -8
  112. package/script/Deploy.s.sol +0 -23
  113. package/script/DeployAutoSwapper.s.sol +0 -30
  114. package/script/DeployDevFactory.s.sol +0 -21
  115. package/script/DeployPostDeploymentHooks.s.sol +0 -20
  116. package/script/DeployUpgradeGate.s.sol +0 -21
  117. package/script/GenerateDeterministicParams.s.sol +0 -43
  118. package/script/PrintRegisterUpgradePath.s.sol +0 -28
  119. package/script/PrintUpgradeCommand.s.sol +0 -13
  120. package/script/TestBackingCoinSwap.s.sol +0 -144
  121. package/script/TestV4Swap.s.sol +0 -133
  122. package/script/UpgradeCoinImpl.sol +0 -23
  123. package/script/UpgradeFactoryImpl.s.sol +0 -28
  124. package/script/UpgradeHooks.s.sol +0 -23
  125. package/src/deployment/CoinsDeployerBase.sol +0 -276
  126. /package/{test → src}/utils/ProxyShim.sol +0 -0
@@ -1,24 +1,18 @@
1
1
 
2
- > @zoralabs/coins@2.3.1 build:js /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
2
+ > @zoralabs/coins@2.4.1 build:js /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
3
3
  > pnpm run wagmi:generate && pnpm run copy-abis && pnpm run prettier:write && tsup
4
4
 
5
5
 
6
- > @zoralabs/coins@2.3.1 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
6
+ > @zoralabs/coins@2.4.1 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
7
7
  > pnpm run build:contracts:minimal && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts
8
8
 
9
9
 
10
- > @zoralabs/coins@2.3.1 build:contracts:minimal /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
11
- > forge build --skip test --skip script --no-metadata
12
-
13
- Compiling 224 files with Solc 0.8.28
14
- Solc 0.8.28 finished in 97.96s
15
- Compiler run successful with warnings:
16
- Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
17
- --> test/utils/BaseTest.sol:440:36:
18
- |
19
- 440 | function _deployHooksNonForked(address airlockAddress) internal {
20
- | ^^^^^^^^^^^^^^^^^^^^^^
10
+ > @zoralabs/coins@2.4.1 build:contracts:minimal /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
11
+ > forge build src/ --no-metadata
21
12
 
13
+ Compiling 183 files with Solc 0.8.28
14
+ Solc 0.8.28 finished in 48.05s
15
+ Compiler run successful!
22
16
  - Validating plugins
23
17
  ✔ Validating plugins
24
18
  - Resolving contracts
@@ -32,129 +26,126 @@ Warning (5667): Unused function parameter. Remove or comment out the variable na
32
26
  ✅ Updated ./package/wagmiGenerated.ts (10 replacements)
33
27
  ✨ All files processed successfully!
34
28
 
35
- > @zoralabs/coins@2.3.1 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
29
+ > @zoralabs/coins@2.4.1 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
36
30
  > pnpm exec bundle-abis
37
31
 
38
32
 
39
- > @zoralabs/coins@2.3.1 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
40
- > prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
33
+ > @zoralabs/coins@2.4.1 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
34
+ > prettier --write 'src/**/*.sol' 'test/**/*.sol'
41
35
 
42
- src/BaseCoin.sol 772ms (unchanged)
43
- src/ContentCoin.sol 61ms (unchanged)
44
- src/CreatorCoin.sol 103ms (unchanged)
45
- src/deployment/CoinsDeployerBase.sol 373ms (unchanged)
46
- src/hook-registry/ZoraHookRegistry.sol 156ms (unchanged)
47
- src/hooks/deployment/BaseCoinDeployHook.sol 40ms (unchanged)
48
- src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 293ms (unchanged)
49
- src/hooks/deployment/BuySupplyWithV4SwapHook.sol 256ms (unchanged)
50
- src/hooks/HookUpgradeGate.sol 32ms (unchanged)
51
- src/hooks/ZoraV4CoinHook.sol 269ms (unchanged)
36
+ src/BaseCoin.sol 1004ms (unchanged)
37
+ src/ContentCoin.sol 104ms (unchanged)
38
+ src/CreatorCoin.sol 146ms (unchanged)
39
+ src/deployment/ForkedCoinsAddresses.sol 27ms (unchanged)
40
+ src/hook-registry/ZoraHookRegistry.sol 265ms (unchanged)
41
+ src/hooks/deployment/BaseCoinDeployHook.sol 73ms (unchanged)
42
+ src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 479ms (unchanged)
43
+ src/hooks/deployment/BuySupplyWithV4SwapHook.sol 289ms (unchanged)
44
+ src/hooks/HookUpgradeGate.sol 66ms (unchanged)
45
+ src/hooks/ZoraV4CoinHook.sol 499ms
52
46
  src/interfaces/IAirlock.sol 2ms (unchanged)
53
- src/interfaces/ICoin.sol 27ms (unchanged)
54
- src/interfaces/ICoinComments.sol 4ms (unchanged)
55
- src/interfaces/ICoinDeployHook.sol 2ms (unchanged)
56
- src/interfaces/ICoinV3.sol 5ms (unchanged)
47
+ src/interfaces/ICoin.sol 44ms (unchanged)
48
+ src/interfaces/ICoinComments.sol 2ms (unchanged)
49
+ src/interfaces/ICoinDeployHook.sol 3ms (unchanged)
50
+ src/interfaces/ICoinV3.sol 10ms (unchanged)
57
51
  src/interfaces/ICreatorCoin.sol 2ms (unchanged)
58
- src/interfaces/ICreatorCoinHook.sol 1ms (unchanged)
59
- src/interfaces/IDeployedCoinVersionLookup.sol 1ms (unchanged)
60
- src/interfaces/IDopplerErrors.sol 1ms (unchanged)
61
- src/interfaces/IERC7572.sol 1ms (unchanged)
62
- src/interfaces/IHasRewardsRecipients.sol 1ms (unchanged)
63
- src/interfaces/IHooksUpgradeGate.sol 3ms (unchanged)
64
- src/interfaces/IMsgSender.sol 1ms (unchanged)
65
- src/interfaces/INonfungiblePositionManager.sol 16ms (unchanged)
52
+ src/interfaces/ICreatorCoinHook.sol 2ms (unchanged)
53
+ src/interfaces/IDeployedCoinVersionLookup.sol 2ms (unchanged)
54
+ src/interfaces/IDopplerErrors.sol 2ms (unchanged)
55
+ src/interfaces/IERC7572.sol 2ms (unchanged)
56
+ src/interfaces/IHasRewardsRecipients.sol 2ms (unchanged)
57
+ src/interfaces/IHooksUpgradeGate.sol 5ms (unchanged)
58
+ src/interfaces/IMsgSender.sol 2ms (unchanged)
59
+ src/interfaces/INonfungiblePositionManager.sol 13ms (unchanged)
66
60
  src/interfaces/IPoolConfigEncoding.sol 2ms (unchanged)
67
- src/interfaces/IProtocolRewards.sol 4ms (unchanged)
68
- src/interfaces/ISwapPathRouter.sol 1ms (unchanged)
61
+ src/interfaces/IProtocolRewards.sol 8ms (unchanged)
62
+ src/interfaces/ISupportsLimitOrderFill.sol 4ms (unchanged)
63
+ src/interfaces/ISwapPathRouter.sol 2ms (unchanged)
69
64
  src/interfaces/ISwapRouter.sol 1ms (unchanged)
70
- src/interfaces/IUniswapV3Factory.sol 9ms (unchanged)
71
- src/interfaces/IUniswapV3Pool.sol 7ms (unchanged)
72
- src/interfaces/IUniswapV3SwapCallback.sol 4ms (unchanged)
73
- src/interfaces/IUpgradeableV4Hook.sol 6ms (unchanged)
74
- src/interfaces/IWETH.sol 3ms (unchanged)
75
- src/interfaces/IZoraFactory.sol 12ms (unchanged)
76
- src/interfaces/IZoraHookRegistry.sol 7ms (unchanged)
77
- src/interfaces/IZoraV4CoinHook.sol 6ms (unchanged)
78
- src/libs/CoinCommon.sol 5ms (unchanged)
79
- src/libs/CoinConfigurationVersions.sol 62ms (unchanged)
80
- src/libs/CoinConstants.sol 8ms (unchanged)
81
- src/libs/CoinDopplerMultiCurve.sol 167ms (unchanged)
82
- src/libs/CoinRewardsV4.sol 228ms (unchanged)
83
- src/libs/CoinSetup.sol 50ms (unchanged)
84
- src/libs/DopplerMath.sol 159ms (unchanged)
85
- src/libs/HooksDeployment.sol 129ms (unchanged)
86
- src/libs/PoolStateReader.sol 5ms (unchanged)
87
- src/libs/UniV4SwapHelper.sol 49ms (unchanged)
88
- src/libs/UniV4SwapToCurrency.sol 83ms (unchanged)
89
- src/libs/V4Liquidity.sol 303ms (unchanged)
90
- src/proxy/ZoraFactory.sol 9ms (unchanged)
65
+ src/interfaces/ITrustedMsgSenderProviderLookup.sol 2ms (unchanged)
66
+ src/interfaces/IUniswapV3Factory.sol 11ms (unchanged)
67
+ src/interfaces/IUniswapV3Pool.sol 9ms (unchanged)
68
+ src/interfaces/IUniswapV3SwapCallback.sol 3ms (unchanged)
69
+ src/interfaces/IUpgradeableV4Hook.sol 4ms (unchanged)
70
+ src/interfaces/IWETH.sol 2ms (unchanged)
71
+ src/interfaces/IZoraFactory.sol 31ms (unchanged)
72
+ src/interfaces/IZoraHookRegistry.sol 9ms (unchanged)
73
+ src/interfaces/IZoraLimitOrderBookCoinsInterface.sol 4ms (unchanged)
74
+ src/interfaces/IZoraV4CoinHook.sol 13ms (unchanged)
75
+ src/libs/CoinCommon.sol 13ms (unchanged)
76
+ src/libs/CoinConfigurationVersions.sol 116ms (unchanged)
77
+ src/libs/CoinConstants.sol 18ms (unchanged)
78
+ src/libs/CoinDopplerMultiCurve.sol 309ms (unchanged)
79
+ src/libs/CoinRewardsV4.sol 327ms (unchanged)
80
+ src/libs/CoinSetup.sol 78ms (unchanged)
81
+ src/libs/DopplerMath.sol 287ms (unchanged)
82
+ src/libs/HooksDeployment.sol 247ms (unchanged)
83
+ src/libs/PoolStateReader.sol 6ms (unchanged)
84
+ src/libs/UniV4SwapHelper.sol 187ms (unchanged)
85
+ src/libs/UniV4SwapToCurrency.sol 99ms (unchanged)
86
+ src/libs/V3ToV4SwapLib.sol 200ms (unchanged)
87
+ src/libs/V4Liquidity.sol 577ms (unchanged)
88
+ src/proxy/ZoraFactory.sol 17ms (unchanged)
91
89
  src/types/LpPosition.sol 1ms (unchanged)
92
90
  src/types/PoolConfiguration.sol 1ms (unchanged)
93
- src/types/PoolState.sol 4ms (unchanged)
94
- src/utils/AutoSwapper.sol 33ms (unchanged)
95
- src/utils/DeployedCoinVersionLookup.sol 7ms (unchanged)
96
- src/utils/MultiOwnable.sol 72ms (unchanged)
97
- src/utils/uniswap/BitMath.sol 9ms (unchanged)
98
- src/utils/uniswap/CustomRevert.sol 54ms (unchanged)
99
- src/utils/uniswap/FixedPoint96.sol 1ms (unchanged)
100
- src/utils/uniswap/FullMath.sol 35ms (unchanged)
101
- src/utils/uniswap/LiquidityAmounts.sol 83ms (unchanged)
102
- src/utils/uniswap/SafeCast.sol 26ms (unchanged)
103
- src/utils/uniswap/SqrtPriceMath.sol 115ms (unchanged)
104
- src/utils/uniswap/TickMath.sol 118ms (unchanged)
105
- src/utils/uniswap/UnsafeMath.sol 3ms (unchanged)
106
- src/version/ContractVersionBase.sol 1ms (unchanged)
107
- src/ZoraFactoryImpl.sol 213ms (unchanged)
108
- test/AutoSwapper.t.sol 92ms (unchanged)
109
- test/BuySupplyWithV4SwapHook.t.sol 254ms (unchanged)
110
- test/Coin.t.sol 217ms (unchanged)
111
- test/CoinRewardsV4.t.sol 16ms (unchanged)
112
- test/CoinUniV4.t.sol 618ms (unchanged)
113
- test/ContentCoinRewards.t.sol 219ms (unchanged)
114
- test/CreatorCoin.t.sol 275ms (unchanged)
115
- test/CreatorCoinRewards.t.sol 188ms (unchanged)
116
- test/DeploymentHooks.t.sol 147ms (unchanged)
117
- test/Factory.t.sol 148ms (unchanged)
118
- test/HooksDeployment.t.sol 49ms (unchanged)
119
- test/LiquidityMigration.t.sol 406ms (unchanged)
120
- test/mocks/MockAirlock.sol 4ms (unchanged)
91
+ src/types/PoolState.sol 2ms (unchanged)
92
+ src/utils/AutoSwapper.sol 59ms (unchanged)
93
+ src/utils/DeployedCoinVersionLookup.sol 17ms (unchanged)
94
+ src/utils/MultiOwnable.sol 132ms (unchanged)
95
+ src/utils/ProxyShim.sol 10ms (unchanged)
96
+ src/utils/TrustedMsgSenderProviderLookup.sol 76ms (unchanged)
97
+ src/utils/uniswap/BitMath.sol 18ms (unchanged)
98
+ src/utils/uniswap/CustomRevert.sol 102ms (unchanged)
99
+ src/utils/uniswap/FixedPoint96.sol 2ms (unchanged)
100
+ src/utils/uniswap/FullMath.sol 71ms (unchanged)
101
+ src/utils/uniswap/LiquidityAmounts.sol 156ms (unchanged)
102
+ src/utils/uniswap/SafeCast.sol 44ms (unchanged)
103
+ src/utils/uniswap/SqrtPriceMath.sol 199ms (unchanged)
104
+ src/utils/uniswap/TickMath.sol 166ms (unchanged)
105
+ src/utils/uniswap/UnsafeMath.sol 5ms (unchanged)
106
+ src/version/ContractVersionBase.sol 2ms (unchanged)
107
+ src/ZoraFactoryImpl.sol 328ms (unchanged)
108
+ test/AutoSwapper.t.sol 113ms (unchanged)
109
+ test/BuySupplyWithV4SwapHook.t.sol 409ms (unchanged)
110
+ test/Coin.t.sol 430ms (unchanged)
111
+ test/CoinRewardsV4.t.sol 33ms (unchanged)
112
+ test/CoinUniV4.t.sol 1210ms (unchanged)
113
+ test/ContentCoinRewards.t.sol 337ms (unchanged)
114
+ test/CreatorCoin.t.sol 550ms (unchanged)
115
+ test/CreatorCoinRewards.t.sol 363ms (unchanged)
116
+ test/DeploymentHooks.t.sol 305ms (unchanged)
117
+ test/Factory.t.sol 422ms (unchanged)
118
+ test/HooksDeployment.t.sol 211ms (unchanged)
119
+ test/LiquidityMigration.t.sol 400ms (unchanged)
120
+ test/mocks/MockAirlock.sol 5ms (unchanged)
121
121
  test/mocks/MockERC20.sol 3ms (unchanged)
122
- test/mocks/SimpleERC20.sol 2ms (unchanged)
123
- test/MultiOwnable.t.sol 140ms (unchanged)
124
- test/Upgrades.t.sol 175ms (unchanged)
125
- test/utils/BaseTest.sol 392ms (unchanged)
122
+ test/mocks/MockSwapRouter.sol 4ms (unchanged)
123
+ test/mocks/MockZoraLimitOrderBook.sol 2ms (unchanged)
124
+ test/mocks/SimpleERC20.sol 5ms (unchanged)
125
+ test/MultiOwnable.t.sol 147ms (unchanged)
126
+ test/TrustedMsgSenderProviderLookup.t.sol 83ms (unchanged)
127
+ test/Upgrades.t.sol 141ms (unchanged)
128
+ test/utils/BaseTest.sol 33ms (unchanged)
126
129
  test/utils/ContractAddresses.sol 3ms (unchanged)
127
- test/utils/DeployedCoinVersionLookup.t.sol 70ms (unchanged)
128
- test/utils/FeeEstimatorHook.sol 45ms (unchanged)
129
- test/utils/hookmate/artifacts/DeployHelper.sol 12ms (unchanged)
130
- test/utils/hookmate/artifacts/Permit2.sol 13ms (unchanged)
131
- test/utils/hookmate/artifacts/UniversalRouter.sol 16ms (unchanged)
132
- test/utils/hookmate/artifacts/V4PoolManager.sol 7ms (unchanged)
133
- test/utils/hookmate/artifacts/V4PositionManager.sol 10ms (unchanged)
134
- test/utils/hookmate/artifacts/V4Quoter.sol 7ms (unchanged)
130
+ test/utils/DeployedCoinVersionLookup.t.sol 63ms (unchanged)
131
+ test/utils/FeeEstimatorHook.sol 47ms (unchanged)
132
+ test/utils/hookmate/artifacts/DeployHelper.sol 10ms (unchanged)
133
+ test/utils/hookmate/artifacts/Permit2.sol 8ms (unchanged)
134
+ test/utils/hookmate/artifacts/UniversalRouter.sol 7ms (unchanged)
135
+ test/utils/hookmate/artifacts/V4PoolManager.sol 14ms (unchanged)
136
+ test/utils/hookmate/artifacts/V4PositionManager.sol 13ms (unchanged)
137
+ test/utils/hookmate/artifacts/V4Quoter.sol 6ms (unchanged)
135
138
  test/utils/hookmate/artifacts/V4Router.sol 7ms (unchanged)
136
- test/utils/hookmate/constants/AddressConstants.sol 69ms (unchanged)
137
- test/utils/hookmate/interfaces/router/IUniswapV4Router04.sol 25ms (unchanged)
139
+ test/utils/hookmate/constants/AddressConstants.sol 74ms (unchanged)
140
+ test/utils/hookmate/interfaces/router/IUniswapV4Router04.sol 9ms (unchanged)
138
141
  test/utils/hookmate/interfaces/router/PathKey.sol 17ms (unchanged)
139
- test/utils/hookmate/test/utils/SwapFeeEventAsserter.sol 20ms (unchanged)
140
- test/utils/ProtocolRewards.sol 451ms (unchanged)
141
- test/utils/ProxyShim.sol 10ms (unchanged)
142
- test/utils/RewardTestHelpers.sol 76ms (unchanged)
143
- test/V4Liquidity.t.sol 116ms (unchanged)
144
- test/ZoraHookRegistry.t.sol 223ms (unchanged)
145
- script/Deploy.s.sol 15ms (unchanged)
146
- script/DeployAutoSwapper.s.sol 13ms (unchanged)
147
- script/DeployDevFactory.s.sol 6ms (unchanged)
148
- script/DeployPostDeploymentHooks.s.sol 11ms (unchanged)
149
- script/DeployUpgradeGate.s.sol 6ms (unchanged)
150
- script/GenerateDeterministicParams.s.sol 27ms (unchanged)
151
- script/PrintRegisterUpgradePath.s.sol 17ms (unchanged)
152
- script/PrintUpgradeCommand.s.sol 5ms (unchanged)
153
- script/TestBackingCoinSwap.s.sol 87ms (unchanged)
154
- script/TestV4Swap.s.sol 67ms (unchanged)
155
- script/UpgradeCoinImpl.sol 8ms (unchanged)
156
- script/UpgradeFactoryImpl.s.sol 10ms (unchanged)
157
- script/UpgradeHooks.s.sol 8ms (unchanged)
142
+ test/utils/hookmate/test/utils/SwapFeeEventAsserter.sol 18ms (unchanged)
143
+ test/utils/ProtocolRewards.sol 480ms (unchanged)
144
+ test/utils/RewardTestHelpers.sol 87ms (unchanged)
145
+ test/utils/TrustedSenderTestHelper.sol 4ms (unchanged)
146
+ test/utils/V4TestSetup.sol 422ms (unchanged)
147
+ test/V4Liquidity.t.sol 112ms (unchanged)
148
+ test/ZoraHookRegistry.t.sol 243ms (unchanged)
158
149
  CLI Building entry: package/index.ts
159
150
  CLI Using tsconfig: tsconfig.json
160
151
  CLI tsup v8.4.0
@@ -163,9 +154,9 @@ script/UpgradeHooks.s.sol 8ms (unchanged)
163
154
  CLI Cleaning output folder
164
155
  CJS Build start
165
156
  ESM Build start
166
- CJS dist/index.cjs 135.99 KB
167
- CJS dist/index.cjs.map 240.37 KB
168
- CJS ⚡️ Build success in 93ms
169
- ESM dist/index.js 134.57 KB
170
- ESM dist/index.js.map 240.22 KB
171
- ESM ⚡️ Build success in 97ms
157
+ CJS dist/index.cjs 164.42 KB
158
+ CJS dist/index.cjs.map 288.61 KB
159
+ CJS ⚡️ Build success in 82ms
160
+ ESM dist/index.js 163.01 KB
161
+ ESM dist/index.js.map 288.46 KB
162
+ ESM ⚡️ Build success in 83ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @zoralabs/coins
2
2
 
3
+ ## 2.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - cf172fdb: Make call to calculatePositions external to save on contract size
8
+
9
+ ## 2.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 09fb2528: Make trusted senders in coin hooks modifiable
14
+
15
+ Trusted message senders can now be added or removed after hook deployment instead of being hardcoded at deployment time.
16
+
17
+ ### Patch Changes
18
+
19
+ - b41a2773: Fix double-counting of fees in burnPositions during liquidity migration
20
+
21
+ Previously, the `burnPositions()` function was incorrectly adding `feesAccrued` to `callerDelta` when recording burned position amounts. Since `callerDelta` already includes accrued fees, this caused fees to be double-counted. This resulted in inflated token amounts being recorded in `BurnedPosition` structs, which could lead to `ERC20InsufficientBalance` errors when attempting to mint positions on a new hook during migration.
22
+
23
+ The fix:
24
+
25
+ - Use only `callerDelta` values directly without adding `feesAccrued`
26
+ - Add defensive balance checking in `mintPositions()` to cap liquidity at available token amounts
27
+ - Prevents migration failures from any remaining rounding discrepancies between burn and mint operations
28
+
29
+ - 8dc766eb: Fix incorrect senderIsTrusted logic for address(0) in ZoraV4CoinHook
30
+
31
+ Removes the special case handling for address(0) in the \_getOriginalMsgSender function that was incorrectly setting senderIsTrusted to true. This behavior was unintentionally changed in commit 09fb2528 which added special handling for address(0). This fix restores the original behavior where address(0) returns false for senderIsTrusted,
32
+
3
33
  ## 2.3.1
4
34
 
5
35
  ### Patch Changes
package/abis/Address.json CHANGED
@@ -9,21 +9,5 @@
9
9
  "internalType": "address"
10
10
  }
11
11
  ]
12
- },
13
- {
14
- "type": "error",
15
- "name": "AddressInsufficientBalance",
16
- "inputs": [
17
- {
18
- "name": "account",
19
- "type": "address",
20
- "internalType": "address"
21
- }
22
- ]
23
- },
24
- {
25
- "type": "error",
26
- "name": "FailedInnerCall",
27
- "inputs": []
28
12
  }
29
13
  ]
@@ -100,28 +100,6 @@
100
100
  ],
101
101
  "stateMutability": "nonpayable"
102
102
  },
103
- {
104
- "type": "error",
105
- "name": "AddressEmptyCode",
106
- "inputs": [
107
- {
108
- "name": "target",
109
- "type": "address",
110
- "internalType": "address"
111
- }
112
- ]
113
- },
114
- {
115
- "type": "error",
116
- "name": "AddressInsufficientBalance",
117
- "inputs": [
118
- {
119
- "name": "account",
120
- "type": "address",
121
- "internalType": "address"
122
- }
123
- ]
124
- },
125
103
  {
126
104
  "type": "error",
127
105
  "name": "AddressZero",
@@ -154,11 +132,6 @@
154
132
  "name": "Erc20NotReceived",
155
133
  "inputs": []
156
134
  },
157
- {
158
- "type": "error",
159
- "name": "FailedInnerCall",
160
- "inputs": []
161
- },
162
135
  {
163
136
  "type": "error",
164
137
  "name": "HookNotImplemented",
@@ -337,38 +337,11 @@
337
337
  ],
338
338
  "anonymous": false
339
339
  },
340
- {
341
- "type": "error",
342
- "name": "AddressEmptyCode",
343
- "inputs": [
344
- {
345
- "name": "target",
346
- "type": "address",
347
- "internalType": "address"
348
- }
349
- ]
350
- },
351
- {
352
- "type": "error",
353
- "name": "AddressInsufficientBalance",
354
- "inputs": [
355
- {
356
- "name": "account",
357
- "type": "address",
358
- "internalType": "address"
359
- }
360
- ]
361
- },
362
340
  {
363
341
  "type": "error",
364
342
  "name": "AddressZero",
365
343
  "inputs": []
366
344
  },
367
- {
368
- "type": "error",
369
- "name": "FailedInnerCall",
370
- "inputs": []
371
- },
372
345
  {
373
346
  "type": "error",
374
347
  "name": "HookNotImplemented",
@@ -416,11 +389,6 @@
416
389
  }
417
390
  ]
418
391
  },
419
- {
420
- "type": "error",
421
- "name": "V3RouteCannotStartWithInputCurrency",
422
- "inputs": []
423
- },
424
392
  {
425
393
  "type": "error",
426
394
  "name": "V3RouteDoesNotConnectToV4RouteStart",
package/abis/Clones.json CHANGED
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "type": "error",
4
- "name": "ERC1167FailedCreateClone",
4
+ "name": "CloneArgumentsTooLong",
5
5
  "inputs": []
6
6
  }
7
7
  ]
@@ -1,9 +1,102 @@
1
1
  [
2
+ {
3
+ "type": "function",
4
+ "name": "calculatePositions",
5
+ "inputs": [
6
+ {
7
+ "name": "isCoinToken0",
8
+ "type": "bool",
9
+ "internalType": "bool"
10
+ },
11
+ {
12
+ "name": "poolConfiguration",
13
+ "type": "tuple",
14
+ "internalType": "struct PoolConfiguration",
15
+ "components": [
16
+ {
17
+ "name": "version",
18
+ "type": "uint8",
19
+ "internalType": "uint8"
20
+ },
21
+ {
22
+ "name": "numPositions",
23
+ "type": "uint16",
24
+ "internalType": "uint16"
25
+ },
26
+ {
27
+ "name": "fee",
28
+ "type": "uint24",
29
+ "internalType": "uint24"
30
+ },
31
+ {
32
+ "name": "tickSpacing",
33
+ "type": "int24",
34
+ "internalType": "int24"
35
+ },
36
+ {
37
+ "name": "numDiscoveryPositions",
38
+ "type": "uint16[]",
39
+ "internalType": "uint16[]"
40
+ },
41
+ {
42
+ "name": "tickLower",
43
+ "type": "int24[]",
44
+ "internalType": "int24[]"
45
+ },
46
+ {
47
+ "name": "tickUpper",
48
+ "type": "int24[]",
49
+ "internalType": "int24[]"
50
+ },
51
+ {
52
+ "name": "maxDiscoverySupplyShare",
53
+ "type": "uint256[]",
54
+ "internalType": "uint256[]"
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ "name": "totalSupply",
60
+ "type": "uint256",
61
+ "internalType": "uint256"
62
+ }
63
+ ],
64
+ "outputs": [
65
+ {
66
+ "name": "positions",
67
+ "type": "tuple[]",
68
+ "internalType": "struct LpPosition[]",
69
+ "components": [
70
+ {
71
+ "name": "tickLower",
72
+ "type": "int24",
73
+ "internalType": "int24"
74
+ },
75
+ {
76
+ "name": "tickUpper",
77
+ "type": "int24",
78
+ "internalType": "int24"
79
+ },
80
+ {
81
+ "name": "liquidity",
82
+ "type": "uint128",
83
+ "internalType": "uint128"
84
+ }
85
+ ]
86
+ }
87
+ ],
88
+ "stateMutability": "pure"
89
+ },
2
90
  {
3
91
  "type": "error",
4
92
  "name": "ArrayLengthMismatch",
5
93
  "inputs": []
6
94
  },
95
+ {
96
+ "type": "error",
97
+ "name": "CannotMintZeroLiquidity",
98
+ "inputs": []
99
+ },
7
100
  {
8
101
  "type": "error",
9
102
  "name": "ConfigTickLowerMustBeLessThanTickUpper",
@@ -25,6 +118,22 @@
25
118
  }
26
119
  ]
27
120
  },
121
+ {
122
+ "type": "error",
123
+ "name": "InvalidTickRangeMisordered",
124
+ "inputs": [
125
+ {
126
+ "name": "tickLower",
127
+ "type": "int24",
128
+ "internalType": "int24"
129
+ },
130
+ {
131
+ "name": "tickUpper",
132
+ "type": "int24",
133
+ "internalType": "int24"
134
+ }
135
+ ]
136
+ },
28
137
  {
29
138
  "type": "error",
30
139
  "name": "ZeroDiscoveryPositions",
package/abis/Create2.json CHANGED
@@ -3,26 +3,5 @@
3
3
  "type": "error",
4
4
  "name": "Create2EmptyBytecode",
5
5
  "inputs": []
6
- },
7
- {
8
- "type": "error",
9
- "name": "Create2FailedDeployment",
10
- "inputs": []
11
- },
12
- {
13
- "type": "error",
14
- "name": "Create2InsufficientBalance",
15
- "inputs": [
16
- {
17
- "name": "balance",
18
- "type": "uint256",
19
- "internalType": "uint256"
20
- },
21
- {
22
- "name": "needed",
23
- "type": "uint256",
24
- "internalType": "uint256"
25
- }
26
- ]
27
6
  }
28
7
  ]
@@ -61,7 +61,7 @@
61
61
  },
62
62
  {
63
63
  "type": "error",
64
- "name": "FailedInnerCall",
64
+ "name": "FailedCall",
65
65
  "inputs": []
66
66
  }
67
67
  ]
@@ -1,49 +1,4 @@
1
1
  [
2
- {
3
- "type": "event",
4
- "name": "AdminChanged",
5
- "inputs": [
6
- {
7
- "name": "previousAdmin",
8
- "type": "address",
9
- "indexed": false,
10
- "internalType": "address"
11
- },
12
- {
13
- "name": "newAdmin",
14
- "type": "address",
15
- "indexed": false,
16
- "internalType": "address"
17
- }
18
- ],
19
- "anonymous": false
20
- },
21
- {
22
- "type": "event",
23
- "name": "BeaconUpgraded",
24
- "inputs": [
25
- {
26
- "name": "beacon",
27
- "type": "address",
28
- "indexed": true,
29
- "internalType": "address"
30
- }
31
- ],
32
- "anonymous": false
33
- },
34
- {
35
- "type": "event",
36
- "name": "Upgraded",
37
- "inputs": [
38
- {
39
- "name": "implementation",
40
- "type": "address",
41
- "indexed": true,
42
- "internalType": "address"
43
- }
44
- ],
45
- "anonymous": false
46
- },
47
2
  {
48
3
  "type": "error",
49
4
  "name": "ERC1967InvalidAdmin",