@zoralabs/coins 1.0.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 (43) hide show
  1. package/.turbo/turbo-build.log +123 -75
  2. package/CHANGELOG.md +6 -0
  3. package/abis/BuySupplyWithSwapRouterHook.json +40 -0
  4. package/abis/CoinUniV4Test.json +42 -4
  5. package/abis/FeeEstimatorHook.json +0 -13
  6. package/abis/HooksTest.json +13 -0
  7. package/abis/IZoraFactory.json +19 -0
  8. package/abis/UpgradesTest.json +14 -0
  9. package/abis/ZoraV4CoinHook.json +0 -13
  10. package/addresses/8453.json +7 -8
  11. package/addresses/84532.json +8 -9
  12. package/addresses/dev/8453.json +10 -0
  13. package/dist/index.cjs +15 -1
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.js +15 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/wagmiGenerated.d.ts +30 -0
  18. package/dist/wagmiGenerated.d.ts.map +1 -1
  19. package/foundry.toml +1 -0
  20. package/package/wagmiGenerated.ts +14 -0
  21. package/package.json +1 -1
  22. package/script/Deploy.s.sol +1 -1
  23. package/script/DeployDevFactory.s.sol +2 -2
  24. package/script/DeployHooks.s.sol +1 -1
  25. package/script/PrintUpgradeCommand.s.sol +1 -1
  26. package/script/TestBackingCoinSwap.s.sol +25 -24
  27. package/script/TestV4Swap.s.sol +6 -6
  28. package/script/UpgradeCoinImpl.sol +2 -2
  29. package/script/UpgradeFactoryImpl.s.sol +1 -1
  30. package/src/BaseCoin.sol +14 -0
  31. package/{script → src/deployment}/CoinsDeployerBase.sol +59 -28
  32. package/src/hooks/ZoraV4CoinHook.sol +32 -15
  33. package/src/hooks/deployment/BuySupplyWithSwapRouterHook.sol +64 -4
  34. package/src/interfaces/IZoraFactory.sol +2 -1
  35. package/src/libs/CoinRewardsV4.sol +0 -1
  36. package/src/libs/HooksDeployment.sol +51 -7
  37. package/src/libs/UniV4SwapToCurrency.sol +3 -3
  38. package/src/libs/V4Liquidity.sol +2 -9
  39. package/src/version/ContractVersionBase.sol +1 -1
  40. package/test/CoinUniV4.t.sol +85 -60
  41. package/test/DeploymentHooks.t.sol +51 -10
  42. package/test/Upgrades.t.sol +92 -1
  43. package/test/utils/BaseTest.sol +56 -1
@@ -1,14 +1,62 @@
1
1
 
2
- > @zoralabs/coins@1.0.0 build /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
2
+ > @zoralabs/coins@1.0.1 build /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@1.0.0 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
6
+ > @zoralabs/coins@1.0.1 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
7
7
  > FOUNDRY_PROFILE=dev forge build && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts
8
8
 
9
9
  Compiling 217 files with Solc 0.8.28
10
- Solc 0.8.28 finished in 165.31s
11
- Compiler run successful!
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
+
12
60
  - Validating plugins
13
61
  ✔ Validating plugins
14
62
  - Resolving contracts
@@ -22,99 +70,99 @@ Compiler run successful!
22
70
  ✅ Updated ./package/wagmiGenerated.ts (8 replacements)
23
71
  ✨ All files processed successfully!
24
72
 
25
- > @zoralabs/coins@1.0.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
73
+ > @zoralabs/coins@1.0.1 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
26
74
  > pnpm exec bundle-abis
27
75
 
28
76
 
29
- > @zoralabs/coins@1.0.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
77
+ > @zoralabs/coins@1.0.1 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/coins
30
78
  > prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
31
79
 
32
- src/BaseCoin.sol 310ms (unchanged)
33
- src/Coin.sol 140ms (unchanged)
34
- src/CoinV4.sol 91ms (unchanged)
35
- src/hooks/deployment/BaseCoinDeployHook.sol 20ms (unchanged)
36
- src/hooks/deployment/BuySupplyWithSwapRouterHook.sol 77ms (unchanged)
37
- src/hooks/ZoraV4CoinHook.sol 117ms (unchanged)
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)
38
87
  src/interfaces/IAirlock.sol 1ms (unchanged)
39
- src/interfaces/ICoin.sol 24ms (unchanged)
88
+ src/interfaces/ICoin.sol 10ms (unchanged)
40
89
  src/interfaces/ICoinComments.sol 4ms (unchanged)
41
90
  src/interfaces/ICoinDeployHook.sol 1ms (unchanged)
42
91
  src/interfaces/ICoinV3.sol 3ms (unchanged)
43
- src/interfaces/ICoinV4.sol 3ms (unchanged)
44
- src/interfaces/IDeployedCoinVersionLookup.sol 2ms (unchanged)
92
+ src/interfaces/ICoinV4.sol 2ms (unchanged)
93
+ src/interfaces/IDeployedCoinVersionLookup.sol 1ms (unchanged)
45
94
  src/interfaces/IDopplerErrors.sol 1ms (unchanged)
46
95
  src/interfaces/IERC7572.sol 1ms (unchanged)
47
- src/interfaces/IMsgSender.sol 2ms (unchanged)
48
- src/interfaces/INonfungiblePositionManager.sol 6ms (unchanged)
96
+ src/interfaces/IMsgSender.sol 0ms (unchanged)
97
+ src/interfaces/INonfungiblePositionManager.sol 4ms (unchanged)
49
98
  src/interfaces/IPoolConfigEncoding.sol 1ms (unchanged)
50
- src/interfaces/IProtocolRewards.sol 3ms (unchanged)
99
+ src/interfaces/IProtocolRewards.sol 2ms (unchanged)
51
100
  src/interfaces/ISwapPathRouter.sol 1ms (unchanged)
52
- src/interfaces/ISwapRouter.sol 1ms (unchanged)
101
+ src/interfaces/ISwapRouter.sol 0ms (unchanged)
53
102
  src/interfaces/IUniswapV3Factory.sol 3ms (unchanged)
54
103
  src/interfaces/IUniswapV3Pool.sol 3ms (unchanged)
55
- src/interfaces/IUniswapV3SwapCallback.sol 2ms (unchanged)
56
- src/interfaces/IWETH.sol 3ms (unchanged)
57
- src/interfaces/IZoraFactory.sol 7ms (unchanged)
58
- src/interfaces/IZoraV4CoinHook.sol 10ms (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)
59
108
  src/libs/CoinCommon.sol 4ms (unchanged)
60
- src/libs/CoinConfigurationVersions.sol 62ms (unchanged)
61
- src/libs/CoinConstants.sol 7ms (unchanged)
62
- src/libs/CoinDopplerMultiCurve.sol 125ms (unchanged)
63
- src/libs/CoinDopplerUniV3.sol 30ms (unchanged)
64
- src/libs/CoinRewards.sol 118ms (unchanged)
65
- src/libs/CoinRewardsV4.sol 85ms (unchanged)
66
- src/libs/CoinSetup.sol 19ms (unchanged)
67
- src/libs/CoinSetupV3.sol 11ms (unchanged)
68
- src/libs/DopplerMath.sol 89ms (unchanged)
69
- src/libs/HooksDeployment.sol 36ms (unchanged)
70
- src/libs/MarketConstants.sol 2ms (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)
71
120
  src/libs/PoolStateReader.sol 3ms (unchanged)
72
- src/libs/UniV3BuySell.sol 78ms (unchanged)
121
+ src/libs/UniV3BuySell.sol 77ms (unchanged)
73
122
  src/libs/UniV3Errors.sol 1ms (unchanged)
74
- src/libs/UniV4SwapHelper.sol 36ms (unchanged)
75
- src/libs/UniV4SwapToCurrency.sol 52ms (unchanged)
76
- src/libs/V4Liquidity.sol 57ms (unchanged)
77
- src/proxy/ZoraFactory.sol 11ms (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)
78
127
  src/types/LpPosition.sol 1ms (unchanged)
79
128
  src/types/PoolConfiguration.sol 1ms (unchanged)
80
- src/types/PoolState.sol 1ms (unchanged)
81
- src/utils/DeployedCoinVersionLookup.sol 8ms (unchanged)
82
- src/utils/MultiOwnable.sol 42ms (unchanged)
83
- src/utils/uniswap/BitMath.sol 11ms (unchanged)
84
- src/utils/uniswap/CustomRevert.sol 51ms (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)
85
134
  src/utils/uniswap/FixedPoint96.sol 1ms (unchanged)
86
- src/utils/uniswap/FullMath.sol 21ms (unchanged)
87
- src/utils/uniswap/LiquidityAmounts.sol 42ms (unchanged)
88
- src/utils/uniswap/SafeCast.sol 16ms (unchanged)
89
- src/utils/uniswap/SqrtPriceMath.sol 58ms (unchanged)
90
- src/utils/uniswap/TickMath.sol 58ms (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)
91
140
  src/utils/uniswap/UnsafeMath.sol 2ms (unchanged)
92
141
  src/version/ContractVersionBase.sol 1ms (unchanged)
93
- src/ZoraFactoryImpl.sol 129ms (unchanged)
94
- test/Coin.t.sol 306ms (unchanged)
95
- test/CoinDopplerUniV3.t.sol 109ms (unchanged)
96
- test/CoinUniV4.t.sol 336ms (unchanged)
97
- test/DeploymentHooks.t.sol 81ms (unchanged)
98
- test/Factory.t.sol 155ms (unchanged)
99
- test/mocks/MockERC20.sol 3ms (unchanged)
100
- test/MultiOwnable.t.sol 85ms (unchanged)
101
- test/Upgrades.t.sol 21ms (unchanged)
102
- test/utils/BaseTest.sol 108ms (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)
103
152
  test/utils/DeployedCoinVersionLookup.t.sol 36ms (unchanged)
104
- test/utils/FeeEstimatorHook.sol 21ms (unchanged)
105
- test/utils/ProtocolRewards.sol 271ms (unchanged)
106
- test/utils/ProxyShim.sol 3ms (unchanged)
107
- script/CoinsDeployerBase.sol 69ms (unchanged)
153
+ test/utils/FeeEstimatorHook.sol 22ms (unchanged)
154
+ test/utils/ProtocolRewards.sol 274ms (unchanged)
155
+ test/utils/ProxyShim.sol 6ms (unchanged)
108
156
  script/Deploy.s.sol 3ms (unchanged)
109
157
  script/DeployDevFactory.s.sol 3ms (unchanged)
110
- script/DeployHooks.s.sol 4ms (unchanged)
158
+ script/DeployHooks.s.sol 3ms (unchanged)
111
159
  script/GenerateDeterministicParams.s.sol 10ms (unchanged)
112
- script/PrintUpgradeCommand.s.sol 9ms (unchanged)
113
- script/Simulate.s.sol 14ms (unchanged)
114
- script/TestBackingCoinSwap.s.sol 35ms (unchanged)
115
- script/TestV4Swap.s.sol 31ms (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)
116
164
  script/UpgradeCoinImpl.sol 4ms (unchanged)
117
- script/UpgradeFactoryImpl.s.sol 4ms (unchanged)
165
+ script/UpgradeFactoryImpl.s.sol 5ms (unchanged)
118
166
  CLI Building entry: package/index.ts
119
167
  CLI Using tsconfig: tsconfig.json
120
168
  CLI tsup v8.4.0
@@ -123,9 +171,9 @@ script/UpgradeFactoryImpl.s.sol 4ms (unchanged)
123
171
  CLI Cleaning output folder
124
172
  CJS Build start
125
173
  ESM Build start
126
- CJS dist/index.cjs 89.57 KB
127
- CJS dist/index.cjs.map 158.74 KB
128
- CJS ⚡️ Build success in 33ms
129
- ESM dist/index.js 88.24 KB
130
- ESM dist/index.js.map 158.60 KB
131
- ESM ⚡️ Build success in 34ms
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,11 @@
1
1
  # @zoralabs/coins
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 8cd56863: BuySupplyWithSwapRouterHook supports v4 coins
8
+
3
9
  ## 1.0.0
4
10
 
5
11
  ### Major Changes
@@ -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",
@@ -319,15 +319,53 @@
319
319
  },
320
320
  {
321
321
  "type": "function",
322
- "name": "test_canSwapCoinForCurrency",
323
- "inputs": [],
322
+ "name": "test_canSwapCoinForCurrencyCoinIsFirst",
323
+ "inputs": [
324
+ {
325
+ "name": "amountIn",
326
+ "type": "uint128",
327
+ "internalType": "uint128"
328
+ }
329
+ ],
324
330
  "outputs": [],
325
331
  "stateMutability": "nonpayable"
326
332
  },
327
333
  {
328
334
  "type": "function",
329
- "name": "test_canSwapCurrencyForCoin",
330
- "inputs": [],
335
+ "name": "test_canSwapCoinForCurrencyCoinIsSecond",
336
+ "inputs": [
337
+ {
338
+ "name": "amountIn",
339
+ "type": "uint128",
340
+ "internalType": "uint128"
341
+ }
342
+ ],
343
+ "outputs": [],
344
+ "stateMutability": "nonpayable"
345
+ },
346
+ {
347
+ "type": "function",
348
+ "name": "test_canSwapCurrencyForCoinCoinIsFirst",
349
+ "inputs": [
350
+ {
351
+ "name": "amountIn",
352
+ "type": "uint128",
353
+ "internalType": "uint128"
354
+ }
355
+ ],
356
+ "outputs": [],
357
+ "stateMutability": "nonpayable"
358
+ },
359
+ {
360
+ "type": "function",
361
+ "name": "test_canSwapCurrencyForCoinCoinIsSecond",
362
+ "inputs": [
363
+ {
364
+ "name": "amountIn",
365
+ "type": "uint128",
366
+ "internalType": "uint128"
367
+ }
368
+ ],
331
369
  "outputs": [],
332
370
  "stateMutability": "nonpayable"
333
371
  },
@@ -802,19 +802,6 @@
802
802
  ],
803
803
  "stateMutability": "nonpayable"
804
804
  },
805
- {
806
- "type": "function",
807
- "name": "contractVersion",
808
- "inputs": [],
809
- "outputs": [
810
- {
811
- "name": "",
812
- "type": "string",
813
- "internalType": "string"
814
- }
815
- ],
816
- "stateMutability": "pure"
817
- },
818
805
  {
819
806
  "type": "function",
820
807
  "name": "feeState",
@@ -263,6 +263,19 @@
263
263
  "outputs": [],
264
264
  "stateMutability": "nonpayable"
265
265
  },
266
+ {
267
+ "type": "function",
268
+ "name": "test_buySupplyWithEthUsingV4Hook_withExactInputMultiHop",
269
+ "inputs": [
270
+ {
271
+ "name": "initialOrderSize",
272
+ "type": "uint256",
273
+ "internalType": "uint256"
274
+ }
275
+ ],
276
+ "outputs": [],
277
+ "stateMutability": "nonpayable"
278
+ },
266
279
  {
267
280
  "type": "function",
268
281
  "name": "test_deployWithHook_revertsWhenEthAndNoHook",
@@ -248,6 +248,25 @@
248
248
  ],
249
249
  "stateMutability": "payable"
250
250
  },
251
+ {
252
+ "type": "function",
253
+ "name": "getVersionForDeployedCoin",
254
+ "inputs": [
255
+ {
256
+ "name": "coin",
257
+ "type": "address",
258
+ "internalType": "address"
259
+ }
260
+ ],
261
+ "outputs": [
262
+ {
263
+ "name": "",
264
+ "type": "uint8",
265
+ "internalType": "uint8"
266
+ }
267
+ ],
268
+ "stateMutability": "view"
269
+ },
251
270
  {
252
271
  "type": "function",
253
272
  "name": "implementation",
@@ -236,6 +236,13 @@
236
236
  ],
237
237
  "stateMutability": "view"
238
238
  },
239
+ {
240
+ "type": "function",
241
+ "name": "test_canUpgradeAndSwap",
242
+ "inputs": [],
243
+ "outputs": [],
244
+ "stateMutability": "nonpayable"
245
+ },
239
246
  {
240
247
  "type": "function",
241
248
  "name": "test_canUpgradeFromVersionWithoutContractName",
@@ -257,6 +264,13 @@
257
264
  "outputs": [],
258
265
  "stateMutability": "nonpayable"
259
266
  },
267
+ {
268
+ "type": "function",
269
+ "name": "test_realSwapUsingCurrentCode",
270
+ "inputs": [],
271
+ "outputs": [],
272
+ "stateMutability": "nonpayable"
273
+ },
260
274
  {
261
275
  "type": "event",
262
276
  "name": "log",
@@ -807,19 +807,6 @@
807
807
  ],
808
808
  "stateMutability": "nonpayable"
809
809
  },
810
- {
811
- "type": "function",
812
- "name": "contractVersion",
813
- "inputs": [],
814
- "outputs": [
815
- {
816
- "name": "",
817
- "type": "string",
818
- "internalType": "string"
819
- }
820
- ],
821
- "stateMutability": "pure"
822
- },
823
810
  {
824
811
  "type": "function",
825
812
  "name": "getHookPermissions",
@@ -1,11 +1,10 @@
1
1
  {
2
- "BUY_SUPPLY_WITH_SWAP_ROUTER_HOOK": "0x4269b3ba4522192e0C54197BD0D7131A3abA6256",
3
- "COIN_V3_IMPL": "0x6C7E731a2b5884fFbFd885E0D631d6f49b9F3E53",
4
- "COIN_V4_IMPL": "0x76eEC7c12f960218441e163FAA1921634CA7Ad28",
5
- "COIN_VERSION": "0.9.0",
6
- "DEV_FACTORY": "0x3d7A3f3351855e135CF89AB412A7C2AA449f9296",
7
- "TRUSTED_MESSAGE_SENDERS": "0x0000000000000000000000000000000000000000",
2
+ "BUY_SUPPLY_WITH_SWAP_ROUTER_HOOK": "0xd77038a7f400E8242d2916f7EB5741e689d4aE25",
3
+ "COIN_V3_IMPL": "0xeBCc4B0Cf2cFD448616d3cb42C5825528b60317D",
4
+ "COIN_V4_IMPL": "0x6e4317ED4020539c8F2327f62eb985294C857dCE",
5
+ "COIN_VERSION": "1.0.0",
8
6
  "ZORA_FACTORY": "0x777777751622c0d3258f214F9DF38E35BF45baF3",
9
- "ZORA_FACTORY_IMPL": "0xBdDbb0B745E2B66022Dfe41bF0F17E6d1Af2A771",
10
- "ZORA_V4_COIN_HOOK": "0xf500d19f77827B55eF187fc2599a895844a59040"
7
+ "ZORA_FACTORY_IMPL": "0xED0EAe148FAF9810a0EA96c619be676bF0Cf0101",
8
+ "ZORA_V4_COIN_HOOK": "0xA1eBdD5cA6470Bbd67114331387f2dDa7bfad040",
9
+ "ZORA_V4_COIN_HOOK_SALT": "0x00000000000000000000000000000000000000000000000000000000000035af"
11
10
  }
@@ -1,11 +1,10 @@
1
1
  {
2
- "BUY_SUPPLY_WITH_SWAP_ROUTER_HOOK": "0xBD42CD74A5fBA7570A2943CAC0B6b60C8f3153B2",
3
- "COIN_V3_IMPL": "0x5CD468BD3821B9534690E235bc32d2224A12a809",
4
- "COIN_V4_IMPL": "0xc7410721B2781d6444B56B3DE09236bE661E689E",
5
- "COIN_VERSION": "0.9.0",
6
- "DEV_FACTORY": "0x0000000000000000000000000000000000000000",
7
- "TRUSTED_MESSAGE_SENDERS": "0x0000000000000000000000000000000000000000",
8
- "ZORA_FACTORY": "0x777777751622c0d3258f214F9DF38E35BF45baF3",
9
- "ZORA_FACTORY_IMPL": "0xA93fd17e0b268359186523e24865dAa15661C714",
10
- "ZORA_V4_COIN_HOOK": "0x26Ef93330d685241AafCC257b0D7BE9DAD065040"
2
+ "BUY_SUPPLY_WITH_SWAP_ROUTER_HOOK": "0xE4Ec8cE893Cd41965b1aE27F1ad9798F207427aE",
3
+ "COIN_V3_IMPL": "0x852E59Bb923654005AB737b09c39D4B6b689E6E5",
4
+ "COIN_V4_IMPL": "0x1cAE9ceA75Ac862bb3dF6AAf7BE028EDe8e67Afd",
5
+ "COIN_VERSION": "1.0.0",
6
+ "ZORA_FACTORY": "0xaF88840cb637F2684A9E460316b1678AD6245e4a",
7
+ "ZORA_FACTORY_IMPL": "0xe1b32276965d2D6967A94CD38FcD180a50cF87dA",
8
+ "ZORA_V4_COIN_HOOK": "0xe0eC17Ab9f7ce52cC60DFB64E0A0A705d02Bd040",
9
+ "ZORA_V4_COIN_HOOK_SALT": "0x0000000000000000000000000000000000000000000000000000000000003a82"
11
10
  }
@@ -0,0 +1,10 @@
1
+ {
2
+ "BUY_SUPPLY_WITH_SWAP_ROUTER_HOOK": "0x0a747629609b22E348d0ea9865fC2A5a04ED945d",
3
+ "COIN_V3_IMPL": "0xd04a1A7C2C307813D208Df4ef86F61AeC102Dfab",
4
+ "COIN_V4_IMPL": "0xE60546e9d6D53581D102164320BA7746dDBD515d",
5
+ "COIN_VERSION": "1.0.0",
6
+ "ZORA_FACTORY": "0x3d7A3f3351855e135CF89AB412A7C2AA449f9296",
7
+ "ZORA_FACTORY_IMPL": "0xA6201f38794f06579c5556127BF2D2d792865f8c",
8
+ "ZORA_V4_COIN_HOOK": "0x3825aDFdaaCA18072fe75B960D821A48503CD040",
9
+ "ZORA_V4_COIN_HOOK_SALT": "0x000000000000000000000000000000000000000000000000000000000000d7de"
10
+ }
package/dist/index.cjs CHANGED
@@ -41,7 +41,8 @@ var buySupplyWithSwapRouterHookABI = [
41
41
  internalType: "contract IZoraFactory",
42
42
  type: "address"
43
43
  },
44
- { name: "_swapRouter", internalType: "address", type: "address" }
44
+ { name: "_swapRouter", internalType: "address", type: "address" },
45
+ { name: "_poolManager", internalType: "address", type: "address" }
45
46
  ],
46
47
  stateMutability: "nonpayable"
47
48
  },
@@ -72,16 +73,29 @@ var buySupplyWithSwapRouterHookABI = [
72
73
  outputs: [{ name: "", internalType: "bool", type: "bool" }],
73
74
  stateMutability: "pure"
74
75
  },
76
+ {
77
+ type: "function",
78
+ inputs: [{ name: "data", internalType: "bytes", type: "bytes" }],
79
+ name: "unlockCallback",
80
+ outputs: [{ name: "", internalType: "bytes", type: "bytes" }],
81
+ stateMutability: "nonpayable"
82
+ },
75
83
  { type: "error", inputs: [], name: "AddressZero" },
76
84
  {
77
85
  type: "error",
78
86
  inputs: [{ name: "balance", internalType: "uint256", type: "uint256" }],
79
87
  name: "CoinBalanceNot0"
80
88
  },
89
+ {
90
+ type: "error",
91
+ inputs: [{ name: "balance", internalType: "uint256", type: "uint256" }],
92
+ name: "CurrencyBalanceNot0"
93
+ },
81
94
  { type: "error", inputs: [], name: "Erc20NotReceived" },
82
95
  { type: "error", inputs: [], name: "HookNotImplemented" },
83
96
  { type: "error", inputs: [], name: "InvalidSwapRouterCall" },
84
97
  { type: "error", inputs: [], name: "NotFactory" },
98
+ { type: "error", inputs: [], name: "OnlyPoolManager" },
85
99
  {
86
100
  type: "error",
87
101
  inputs: [{ name: "error", internalType: "bytes", type: "bytes" }],