@zoralabs/protocol-deployments 0.5.4 → 0.5.5-PRE.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.
package/dist/index.js CHANGED
@@ -1,16 +1,81 @@
1
1
  import {
2
2
  BaseError,
3
+ decodeAbiParameters,
3
4
  encodeAbiParameters,
5
+ encodeFunctionData,
4
6
  etherUnits,
5
7
  getAbiItem,
6
8
  keccak256,
7
9
  toHex
8
- } from "./chunk-ETO2D44V.js";
10
+ } from "./chunk-NPNNGXR4.js";
9
11
  import {
10
12
  __export
11
- } from "./chunk-3EJPJMEH.js";
13
+ } from "./chunk-PR4QN5HX.js";
12
14
 
13
15
  // src/generated/wagmi.ts
16
+ var buySupplyWithSwapRouterHookABI = [
17
+ {
18
+ type: "constructor",
19
+ inputs: [
20
+ {
21
+ name: "_factory",
22
+ internalType: "contract IZoraFactory",
23
+ type: "address"
24
+ },
25
+ { name: "_swapRouter", internalType: "address", type: "address" }
26
+ ],
27
+ stateMutability: "nonpayable"
28
+ },
29
+ {
30
+ type: "function",
31
+ inputs: [
32
+ { name: "sender", internalType: "address", type: "address" },
33
+ { name: "coin", internalType: "contract ICoin", type: "address" },
34
+ { name: "hookData", internalType: "bytes", type: "bytes" }
35
+ ],
36
+ name: "afterCoinDeploy",
37
+ outputs: [{ name: "", internalType: "bytes", type: "bytes" }],
38
+ stateMutability: "payable"
39
+ },
40
+ {
41
+ type: "function",
42
+ inputs: [],
43
+ name: "factory",
44
+ outputs: [
45
+ { name: "", internalType: "contract IZoraFactory", type: "address" }
46
+ ],
47
+ stateMutability: "view"
48
+ },
49
+ {
50
+ type: "function",
51
+ inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }],
52
+ name: "supportsInterface",
53
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
54
+ stateMutability: "pure"
55
+ },
56
+ { type: "error", inputs: [], name: "AddressZero" },
57
+ {
58
+ type: "error",
59
+ inputs: [{ name: "balance", internalType: "uint256", type: "uint256" }],
60
+ name: "CoinBalanceNot0"
61
+ },
62
+ { type: "error", inputs: [], name: "Erc20NotReceived" },
63
+ { type: "error", inputs: [], name: "HookNotImplemented" },
64
+ { type: "error", inputs: [], name: "InvalidSwapRouterCall" },
65
+ { type: "error", inputs: [], name: "NotFactory" },
66
+ {
67
+ type: "error",
68
+ inputs: [{ name: "error", internalType: "bytes", type: "bytes" }],
69
+ name: "SwapReverted"
70
+ }
71
+ ];
72
+ var buySupplyWithSwapRouterHookAddress = {
73
+ 84532: "0x6B78be0808262b1d5E9B1eeDfE448aDCE2C637a8"
74
+ };
75
+ var buySupplyWithSwapRouterHookConfig = {
76
+ address: buySupplyWithSwapRouterHookAddress,
77
+ abi: buySupplyWithSwapRouterHookABI
78
+ };
14
79
  var callerAndCommenterABI = [
15
80
  {
16
81
  type: "constructor",
@@ -2059,6 +2124,20 @@ var coinFactoryABI = [
2059
2124
  outputs: [{ name: "", internalType: "address", type: "address" }],
2060
2125
  stateMutability: "view"
2061
2126
  },
2127
+ {
2128
+ type: "function",
2129
+ inputs: [],
2130
+ name: "contractName",
2131
+ outputs: [{ name: "", internalType: "string", type: "string" }],
2132
+ stateMutability: "pure"
2133
+ },
2134
+ {
2135
+ type: "function",
2136
+ inputs: [],
2137
+ name: "contractVersion",
2138
+ outputs: [{ name: "", internalType: "string", type: "string" }],
2139
+ stateMutability: "pure"
2140
+ },
2062
2141
  {
2063
2142
  type: "function",
2064
2143
  inputs: [
@@ -2098,6 +2177,26 @@ var coinFactoryABI = [
2098
2177
  ],
2099
2178
  stateMutability: "payable"
2100
2179
  },
2180
+ {
2181
+ type: "function",
2182
+ inputs: [
2183
+ { name: "payoutRecipient", internalType: "address", type: "address" },
2184
+ { name: "owners", internalType: "address[]", type: "address[]" },
2185
+ { name: "uri", internalType: "string", type: "string" },
2186
+ { name: "name", internalType: "string", type: "string" },
2187
+ { name: "symbol", internalType: "string", type: "string" },
2188
+ { name: "poolConfig", internalType: "bytes", type: "bytes" },
2189
+ { name: "platformReferrer", internalType: "address", type: "address" },
2190
+ { name: "hook", internalType: "address", type: "address" },
2191
+ { name: "hookData", internalType: "bytes", type: "bytes" }
2192
+ ],
2193
+ name: "deployWithHook",
2194
+ outputs: [
2195
+ { name: "coin", internalType: "address", type: "address" },
2196
+ { name: "hookDataOut", internalType: "bytes", type: "bytes" }
2197
+ ],
2198
+ stateMutability: "payable"
2199
+ },
2101
2200
  {
2102
2201
  type: "function",
2103
2202
  inputs: [],
@@ -2276,6 +2375,7 @@ var coinFactoryABI = [
2276
2375
  { type: "error", inputs: [], name: "ERC20TransferAmountMismatch" },
2277
2376
  { type: "error", inputs: [], name: "EthTransferInvalid" },
2278
2377
  { type: "error", inputs: [], name: "FailedInnerCall" },
2378
+ { type: "error", inputs: [], name: "InvalidHook" },
2279
2379
  { type: "error", inputs: [], name: "InvalidInitialization" },
2280
2380
  { type: "error", inputs: [], name: "NotInitializing" },
2281
2381
  {
@@ -2299,6 +2399,14 @@ var coinFactoryABI = [
2299
2399
  type: "error",
2300
2400
  inputs: [{ name: "slot", internalType: "bytes32", type: "bytes32" }],
2301
2401
  name: "UUPSUnsupportedProxiableUUID"
2402
+ },
2403
+ {
2404
+ type: "error",
2405
+ inputs: [
2406
+ { name: "currentName", internalType: "string", type: "string" },
2407
+ { name: "newName", internalType: "string", type: "string" }
2408
+ ],
2409
+ name: "UpgradeToMismatchedContractName"
2302
2410
  }
2303
2411
  ];
2304
2412
  var coinFactoryAddress = {
@@ -6975,6 +7083,29 @@ var sponsoredSparksSpenderConfig = {
6975
7083
  abi: sponsoredSparksSpenderABI
6976
7084
  };
6977
7085
  var uniswapV3SwapRouterABI = [
7086
+ {
7087
+ type: "function",
7088
+ inputs: [
7089
+ {
7090
+ name: "params",
7091
+ internalType: "struct ISwapRouter.ExactInputParams",
7092
+ type: "tuple",
7093
+ components: [
7094
+ { name: "path", internalType: "bytes", type: "bytes" },
7095
+ { name: "recipient", internalType: "address", type: "address" },
7096
+ { name: "amountIn", internalType: "uint256", type: "uint256" },
7097
+ {
7098
+ name: "amountOutMinimum",
7099
+ internalType: "uint256",
7100
+ type: "uint256"
7101
+ }
7102
+ ]
7103
+ }
7104
+ ],
7105
+ name: "exactInput",
7106
+ outputs: [{ name: "amountOut", internalType: "uint256", type: "uint256" }],
7107
+ stateMutability: "payable"
7108
+ },
6978
7109
  {
6979
7110
  type: "function",
6980
7111
  inputs: [
@@ -7005,6 +7136,25 @@ var uniswapV3SwapRouterABI = [
7005
7136
  outputs: [{ name: "amountOut", internalType: "uint256", type: "uint256" }],
7006
7137
  stateMutability: "payable"
7007
7138
  },
7139
+ {
7140
+ type: "function",
7141
+ inputs: [
7142
+ {
7143
+ name: "params",
7144
+ internalType: "struct ISwapRouter.ExactOutputParams",
7145
+ type: "tuple",
7146
+ components: [
7147
+ { name: "path", internalType: "bytes", type: "bytes" },
7148
+ { name: "recipient", internalType: "address", type: "address" },
7149
+ { name: "amountOut", internalType: "uint256", type: "uint256" },
7150
+ { name: "amountInMaximum", internalType: "uint256", type: "uint256" }
7151
+ ]
7152
+ }
7153
+ ],
7154
+ name: "exactOutput",
7155
+ outputs: [{ name: "amountIn", internalType: "uint256", type: "uint256" }],
7156
+ stateMutability: "payable"
7157
+ },
7008
7158
  {
7009
7159
  type: "function",
7010
7160
  inputs: [
@@ -15207,7 +15357,7 @@ var zoraTimedSaleStrategyConfig = {
15207
15357
  abi: zoraTimedSaleStrategyABI
15208
15358
  };
15209
15359
 
15210
- // ../../node_modules/.pnpm/viem@2.22.12_bufferutil@4.0.9_typescript@5.7.3_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/unit.js
15360
+ // ../../node_modules/.pnpm/viem@2.22.12_bufferutil@4.0.9_typescript@5.8.3_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/errors/unit.js
15211
15361
  var InvalidDecimalNumberError = class extends BaseError {
15212
15362
  constructor({ value }) {
15213
15363
  super(`Number \`${value}\` is not a valid decimal number.`, {
@@ -15216,7 +15366,7 @@ var InvalidDecimalNumberError = class extends BaseError {
15216
15366
  }
15217
15367
  };
15218
15368
 
15219
- // ../../node_modules/.pnpm/viem@2.22.12_bufferutil@4.0.9_typescript@5.7.3_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/unit/parseUnits.js
15369
+ // ../../node_modules/.pnpm/viem@2.22.12_bufferutil@4.0.9_typescript@5.8.3_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/unit/parseUnits.js
15220
15370
  function parseUnits(value, decimals) {
15221
15371
  if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(value))
15222
15372
  throw new InvalidDecimalNumberError({ value });
@@ -15251,7 +15401,7 @@ function parseUnits(value, decimals) {
15251
15401
  return BigInt(`${negative ? "-" : ""}${integer}${fraction}`);
15252
15402
  }
15253
15403
 
15254
- // ../../node_modules/.pnpm/viem@2.22.12_bufferutil@4.0.9_typescript@5.7.3_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/unit/parseEther.js
15404
+ // ../../node_modules/.pnpm/viem@2.22.12_bufferutil@4.0.9_typescript@5.8.3_utf-8-validate@5.0.10_zod@3.24.1/node_modules/viem/_esm/utils/unit/parseEther.js
15255
15405
  function parseEther(ether, unit = "wei") {
15256
15406
  return parseUnits(ether, etherUnits[unit]);
15257
15407
  }
@@ -15710,6 +15860,82 @@ var safeTransferSwapAbiParameters = [
15710
15860
  { name: "minEthToAcquire", internalType: "uint256", type: "uint256" },
15711
15861
  { name: "sqrtPriceLimitX96", internalType: "uint160", type: "uint160" }
15712
15862
  ];
15863
+ var buySupplyWithSwapRouterHookAbiParameters = [
15864
+ { name: "buyRecipient", internalType: "address", type: "address" },
15865
+ { name: "swapRouterCall", internalType: "bytes", type: "bytes" }
15866
+ ];
15867
+ var buySupplyWithSwapRouterHookReturnParameters = [
15868
+ { name: "amountCurrency", internalType: "uint256", type: "uint256" },
15869
+ { name: "coinsPurchased", internalType: "uint256", type: "uint256" }
15870
+ ];
15871
+ var encodeBuySupplyWithSwapRouterHookCalldata = (buyRecipient, swapRouterCall) => {
15872
+ return encodeAbiParameters(buySupplyWithSwapRouterHookAbiParameters, [
15873
+ buyRecipient,
15874
+ swapRouterCall
15875
+ ]);
15876
+ };
15877
+ var encodeBuySupplyWithSingleHopSwapRouterHookCall = ({
15878
+ buyRecipient,
15879
+ exactInputSingleParams,
15880
+ chainId,
15881
+ ethValue
15882
+ }) => {
15883
+ const hook = buySupplyWithSwapRouterHookAddress[chainId];
15884
+ const callToSwapRouter = encodeFunctionData({
15885
+ abi: uniswapV3SwapRouterABI,
15886
+ functionName: "exactInputSingle",
15887
+ args: [
15888
+ {
15889
+ recipient: hook,
15890
+ ...exactInputSingleParams
15891
+ }
15892
+ ]
15893
+ });
15894
+ return {
15895
+ hook: encodeBuySupplyWithSwapRouterHookCalldata(hook, callToSwapRouter),
15896
+ hookData: encodeBuySupplyWithSwapRouterHookCalldata(
15897
+ buyRecipient,
15898
+ callToSwapRouter
15899
+ ),
15900
+ value: ethValue
15901
+ };
15902
+ };
15903
+ var encodeBuySupplyWithMultiHopSwapRouterHookCall = ({
15904
+ buyRecipient,
15905
+ exactInputParams,
15906
+ chainId,
15907
+ ethValue
15908
+ }) => {
15909
+ const hook = buySupplyWithSwapRouterHookAddress[chainId];
15910
+ const callToSwapRouter = encodeFunctionData({
15911
+ abi: uniswapV3SwapRouterABI,
15912
+ functionName: "exactInput",
15913
+ args: [
15914
+ {
15915
+ recipient: hook,
15916
+ ...exactInputParams
15917
+ }
15918
+ ]
15919
+ });
15920
+ return {
15921
+ hook: encodeBuySupplyWithSwapRouterHookCalldata(hook, callToSwapRouter),
15922
+ hookData: encodeBuySupplyWithSwapRouterHookCalldata(
15923
+ buyRecipient,
15924
+ callToSwapRouter
15925
+ ),
15926
+ value: ethValue
15927
+ };
15928
+ };
15929
+ var decodeBuySupplyWithSwapRouterHookReturn = (returnData) => {
15930
+ const result = decodeAbiParameters(
15931
+ buySupplyWithSwapRouterHookReturnParameters,
15932
+ returnData
15933
+ );
15934
+ return {
15935
+ amountCurrency: result[0],
15936
+ coinsPurchased: result[1]
15937
+ };
15938
+ };
15713
15939
 
15714
15940
  // src/generated/1155.ts
15715
15941
  var __exports = {};
@@ -16107,6 +16333,11 @@ var addresses2 = {
16107
16333
  };
16108
16334
  export {
16109
16335
  PremintConfigVersion,
16336
+ buySupplyWithSwapRouterHookABI,
16337
+ buySupplyWithSwapRouterHookAbiParameters,
16338
+ buySupplyWithSwapRouterHookAddress,
16339
+ buySupplyWithSwapRouterHookConfig,
16340
+ buySupplyWithSwapRouterHookReturnParameters,
16110
16341
  callerAndCommenterABI,
16111
16342
  callerAndCommenterAddress,
16112
16343
  callerAndCommenterConfig,
@@ -16122,7 +16353,11 @@ export {
16122
16353
  commentsAddress,
16123
16354
  commentsConfig,
16124
16355
  __exports as contracts1155,
16356
+ decodeBuySupplyWithSwapRouterHookReturn,
16125
16357
  emptyCommentIdentifier,
16358
+ encodeBuySupplyWithMultiHopSwapRouterHookCall,
16359
+ encodeBuySupplyWithSingleHopSwapRouterHookCall,
16360
+ encodeBuySupplyWithSwapRouterHookCalldata,
16126
16361
  encodePremintConfig,
16127
16362
  erc20MinterABI,
16128
16363
  erc20MinterAddress,