@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/.turbo/turbo-build.log +47 -46
- package/CHANGELOG.md +11 -0
- package/dist/{_esm-RA774I7E.js → _esm-AN6HMJZC.js} +119 -234
- package/dist/_esm-AN6HMJZC.js.map +1 -0
- package/dist/{ccip-OTD7W43P.js → ccip-C5WONSSK.js} +3 -3
- package/dist/{chunk-ETO2D44V.js → chunk-NPNNGXR4.js} +89 -87
- package/dist/{chunk-ETO2D44V.js.map → chunk-NPNNGXR4.js.map} +1 -1
- package/dist/{chunk-3EJPJMEH.js → chunk-PR4QN5HX.js} +2 -3
- package/dist/encoding.d.ts +85 -0
- package/dist/encoding.d.ts.map +1 -1
- package/dist/generated/wagmi.d.ts +503 -0
- package/dist/generated/wagmi.d.ts.map +1 -1
- package/dist/index.cjs +933 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +240 -5
- package/dist/index.js.map +1 -1
- package/dist/{secp256k1-DTX2GS77.js → secp256k1-QZA5SALG.js} +3 -3
- package/dist/typedData.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/encoding.ts +157 -0
- package/src/generated/wagmi.ts +164 -0
- package/LICENSE +0 -21
- package/dist/_esm-RA774I7E.js.map +0 -1
- /package/dist/{ccip-OTD7W43P.js.map → ccip-C5WONSSK.js.map} +0 -0
- /package/dist/{chunk-3EJPJMEH.js.map → chunk-PR4QN5HX.js.map} +0 -0
- /package/dist/{secp256k1-DTX2GS77.js.map → secp256k1-QZA5SALG.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PR4QN5HX.js";
|
|
4
4
|
|
|
5
5
|
// ../../node_modules/.pnpm/@noble+hashes@1.6.0/node_modules/@noble/hashes/esm/_assert.js
|
|
6
6
|
function anumber(n) {
|
|
@@ -37,7 +37,7 @@ function aoutput(out, instance) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// ../../node_modules/.pnpm/@noble+hashes@1.6.0/node_modules/@noble/hashes/esm/cryptoNode.js
|
|
40
|
-
import * as nc from "crypto";
|
|
40
|
+
import * as nc from "node:crypto";
|
|
41
41
|
var crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0;
|
|
42
42
|
|
|
43
43
|
// ../../node_modules/.pnpm/@noble+hashes@1.6.0/node_modules/@noble/hashes/esm/utils.js
|
|
@@ -2552,4 +2552,4 @@ export {
|
|
|
2552
2552
|
@noble/curves/esm/secp256k1.js:
|
|
2553
2553
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2554
2554
|
*/
|
|
2555
|
-
//# sourceMappingURL=secp256k1-
|
|
2555
|
+
//# sourceMappingURL=secp256k1-QZA5SALG.js.map
|
package/dist/typedData.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../src/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAGP,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,mBAAmB,EAMpB,MAAM,MAAM,CAAC;AACd,OAAO,EACL,oBAAoB,EAEpB,6BAA6B,EAG9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EAKxB,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAiBjB,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBE,CAAC;AA8C/B,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,oBA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,gCAAgC,GAC3C,SAAS,aAAa,EACtB,iBAAiB,OAAO,KACvB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAoC,eAAe,CAAC,GAAG;IAC3E,OAAO,EAAE,OAAO,CAAC;CA6BlB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qCAAqC,GAChD,SAAS,kBAAkB,EAC3B,iBAAiB,OAAO,KACvB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEpB,oBAAoB,CACrB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CA0BrB,CAAC;AAGF,eAAO,MAAM,UAAU,cAA+B,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uCAAuC,GAClD,SAAS,oBAAoB,EAC7B,iBAAiB,OAAO,KACvB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEpB,+BAA+B,CAChC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAwCrB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iDAAiD,GAC5D,SAAS,8BAA8B,EACvC,iBAAiB,OAAO,KACvB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEpB,gCAAgC,CACjC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAyCrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoralabs/protocol-deployments",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5-PRE.0",
|
|
4
4
|
"repository": "https://github.com/ourzora/zora-protocol",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,9 +15,17 @@
|
|
|
15
15
|
"default": "./dist/index.cjs"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "pnpm bundle-configs && pnpm copy-generated && tsup",
|
|
20
|
+
"bundle-configs": "tsx scripts/bundle-configs.ts && pnpm prettier:write",
|
|
21
|
+
"copy-generated": "cp ../protocol-deployments-gen/generated/wagmi.ts src/generated/wagmi.ts",
|
|
22
|
+
"prettier:write": "prettier --write 'src/**/*.ts' 'scripts/*'",
|
|
23
|
+
"lint": "prettier --check 'src/**/*.ts' 'scripts/*'"
|
|
24
|
+
},
|
|
18
25
|
"devDependencies": {
|
|
19
26
|
"@lavamoat/preinstall-always-fail": "2.0.0",
|
|
20
27
|
"@types/node": "^20.3.2",
|
|
28
|
+
"@zoralabs/tsconfig": "workspace:^",
|
|
21
29
|
"abitype": "^1.0.2",
|
|
22
30
|
"es-main": "^1.2.0",
|
|
23
31
|
"prettier": "^3.2.5",
|
|
@@ -25,14 +33,6 @@
|
|
|
25
33
|
"tsup": "^7.2.0",
|
|
26
34
|
"tsx": "^3.13.0",
|
|
27
35
|
"typescript": "^5.2.2",
|
|
28
|
-
"viem": "^2.21.21"
|
|
29
|
-
"@zoralabs/tsconfig": "^0.0.1"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "pnpm bundle-configs && pnpm copy-generated && tsup",
|
|
33
|
-
"bundle-configs": "tsx scripts/bundle-configs.ts && pnpm prettier:write",
|
|
34
|
-
"copy-generated": "cp ../protocol-deployments-gen/generated/wagmi.ts src/generated/wagmi.ts",
|
|
35
|
-
"prettier:write": "prettier --write 'src/**/*.ts' 'scripts/*'",
|
|
36
|
-
"lint": "prettier --check 'src/**/*.ts' 'scripts/*'"
|
|
36
|
+
"viem": "^2.21.21"
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
package/src/encoding.ts
CHANGED
|
@@ -1,6 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Address,
|
|
3
|
+
decodeAbiParameters,
|
|
4
|
+
encodeAbiParameters,
|
|
5
|
+
encodeFunctionData,
|
|
6
|
+
} from "viem";
|
|
7
|
+
import { uniswapV3SwapRouterABI } from "./generated/wagmi";
|
|
8
|
+
import { buySupplyWithSwapRouterHookAddress } from "./generated/wagmi";
|
|
9
|
+
|
|
10
|
+
import { Hex } from "viem";
|
|
11
|
+
import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
|
|
12
|
+
|
|
1
13
|
/** ABI parameters for performing a SafeTransferFrom based swap when selling on secondary. */
|
|
2
14
|
export const safeTransferSwapAbiParameters = [
|
|
3
15
|
{ name: "recipient", internalType: "address payable", type: "address" },
|
|
4
16
|
{ name: "minEthToAcquire", internalType: "uint256", type: "uint256" },
|
|
5
17
|
{ name: "sqrtPriceLimitX96", internalType: "uint160", type: "uint160" },
|
|
6
18
|
] as const;
|
|
19
|
+
|
|
20
|
+
export const buySupplyWithSwapRouterHookAbiParameters = [
|
|
21
|
+
{ name: "buyRecipient", internalType: "address", type: "address" },
|
|
22
|
+
{ name: "swapRouterCall", internalType: "bytes", type: "bytes" },
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
25
|
+
export const buySupplyWithSwapRouterHookReturnParameters = [
|
|
26
|
+
{ name: "amountCurrency", internalType: "uint256", type: "uint256" },
|
|
27
|
+
{ name: "coinsPurchased", internalType: "uint256", type: "uint256" },
|
|
28
|
+
] as const;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Encodes the calldata for the BuySupplyWithSwapRouterHook.
|
|
32
|
+
*
|
|
33
|
+
* @param buyRecipient - The address of the recipient of the coins that are purchased.
|
|
34
|
+
* @param swapRouterCall - The calldata to send for swapping on the swap router. For the call, the recipient of the swap
|
|
35
|
+
* must be the hook contract.
|
|
36
|
+
* @returns The encoded calldata.
|
|
37
|
+
*/
|
|
38
|
+
export const encodeBuySupplyWithSwapRouterHookCalldata = (
|
|
39
|
+
buyRecipient: Address,
|
|
40
|
+
swapRouterCall: Hex,
|
|
41
|
+
) => {
|
|
42
|
+
return encodeAbiParameters(buySupplyWithSwapRouterHookAbiParameters, [
|
|
43
|
+
buyRecipient,
|
|
44
|
+
swapRouterCall,
|
|
45
|
+
]);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type ExactInputSingleParams = AbiParametersToPrimitiveTypes<
|
|
49
|
+
ExtractAbiFunction<
|
|
50
|
+
typeof uniswapV3SwapRouterABI,
|
|
51
|
+
"exactInputSingle"
|
|
52
|
+
>["inputs"]
|
|
53
|
+
>[0];
|
|
54
|
+
|
|
55
|
+
type ExactInputParams = AbiParametersToPrimitiveTypes<
|
|
56
|
+
ExtractAbiFunction<typeof uniswapV3SwapRouterABI, "exactInput">["inputs"]
|
|
57
|
+
>[0];
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Encodes the call data for buying supply with a single-hop swap router hook.
|
|
61
|
+
* This function creates the hook call and hook data needed to buy Coin supply using ETH through a Uniswap V3 single-hop swap.
|
|
62
|
+
*
|
|
63
|
+
* @param buyRecipient - The address that will receive the coins purchased
|
|
64
|
+
* @param exactInputSingleParams - The parameters for the exactInputSingle function on the swap router (recipient is omitted as it will be set to the hook address)
|
|
65
|
+
* @param chainId - The chain ID to use for getting the hook address
|
|
66
|
+
* @param ethValue - Optional amount of ETH to send with the call to the swap router
|
|
67
|
+
* @returns Object containing the encoded hook call, hook data, and ETH value
|
|
68
|
+
*/
|
|
69
|
+
export const encodeBuySupplyWithSingleHopSwapRouterHookCall = ({
|
|
70
|
+
buyRecipient,
|
|
71
|
+
exactInputSingleParams,
|
|
72
|
+
chainId,
|
|
73
|
+
ethValue,
|
|
74
|
+
}: {
|
|
75
|
+
buyRecipient: Address;
|
|
76
|
+
exactInputSingleParams: Omit<ExactInputSingleParams, "recipient">;
|
|
77
|
+
chainId: keyof typeof buySupplyWithSwapRouterHookAddress;
|
|
78
|
+
// optional amount of ETH to send with the call to the swap router
|
|
79
|
+
ethValue?: bigint;
|
|
80
|
+
}) => {
|
|
81
|
+
const hook = buySupplyWithSwapRouterHookAddress[chainId];
|
|
82
|
+
const callToSwapRouter = encodeFunctionData({
|
|
83
|
+
abi: uniswapV3SwapRouterABI,
|
|
84
|
+
functionName: "exactInputSingle",
|
|
85
|
+
args: [
|
|
86
|
+
{
|
|
87
|
+
recipient: hook,
|
|
88
|
+
...exactInputSingleParams,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
hook: encodeBuySupplyWithSwapRouterHookCalldata(hook, callToSwapRouter),
|
|
95
|
+
hookData: encodeBuySupplyWithSwapRouterHookCalldata(
|
|
96
|
+
buyRecipient,
|
|
97
|
+
callToSwapRouter,
|
|
98
|
+
),
|
|
99
|
+
value: ethValue,
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Encodes the call data for buying supply with a multi-hop swap router hook.
|
|
105
|
+
* This function creates the hook call and hook data needed to buy Coin supply using ETH through a Uniswap V3 multi-hop swap.
|
|
106
|
+
*
|
|
107
|
+
* @param buyRecipient - The address that will receive the coins purchased
|
|
108
|
+
* @param exactInputParams - The parameters for the exactInput function on the swap router (recipient is omitted as it will be set to the hook address)
|
|
109
|
+
* @param chainId - The chain ID to use for getting the hook address
|
|
110
|
+
* @param ethValue - Optional amount of ETH to send with the call to the swap router
|
|
111
|
+
* @returns Object containing the encoded hook call, hook data, and ETH value
|
|
112
|
+
*/
|
|
113
|
+
export const encodeBuySupplyWithMultiHopSwapRouterHookCall = ({
|
|
114
|
+
buyRecipient,
|
|
115
|
+
exactInputParams,
|
|
116
|
+
chainId,
|
|
117
|
+
ethValue,
|
|
118
|
+
}: {
|
|
119
|
+
buyRecipient: Address;
|
|
120
|
+
exactInputParams: Omit<ExactInputParams, "recipient">;
|
|
121
|
+
chainId: keyof typeof buySupplyWithSwapRouterHookAddress;
|
|
122
|
+
// optional amount of ETH to send with the call to the swap router
|
|
123
|
+
ethValue?: bigint;
|
|
124
|
+
}) => {
|
|
125
|
+
const hook = buySupplyWithSwapRouterHookAddress[chainId];
|
|
126
|
+
const callToSwapRouter = encodeFunctionData({
|
|
127
|
+
abi: uniswapV3SwapRouterABI,
|
|
128
|
+
functionName: "exactInput",
|
|
129
|
+
args: [
|
|
130
|
+
{
|
|
131
|
+
recipient: hook,
|
|
132
|
+
...exactInputParams,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
hook: encodeBuySupplyWithSwapRouterHookCalldata(hook, callToSwapRouter),
|
|
139
|
+
hookData: encodeBuySupplyWithSwapRouterHookCalldata(
|
|
140
|
+
buyRecipient,
|
|
141
|
+
callToSwapRouter,
|
|
142
|
+
),
|
|
143
|
+
value: ethValue,
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Decodes the return data from the BuySupplyWithSwapRouterHook.
|
|
149
|
+
*
|
|
150
|
+
* @param returnData - The return data from the BuySupplyWithSwapRouterHook.
|
|
151
|
+
* @returns The decoded return data.
|
|
152
|
+
*/
|
|
153
|
+
export const decodeBuySupplyWithSwapRouterHookReturn = (returnData: Hex) => {
|
|
154
|
+
const result = decodeAbiParameters(
|
|
155
|
+
buySupplyWithSwapRouterHookReturnParameters,
|
|
156
|
+
returnData,
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
return {
|
|
160
|
+
amountCurrency: result[0],
|
|
161
|
+
coinsPurchased: result[1],
|
|
162
|
+
};
|
|
163
|
+
};
|
package/src/generated/wagmi.ts
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// BuySupplyWithSwapRouterHook
|
|
3
|
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* [__View Contract on Base Sepolia Basescan__](https://sepolia.basescan.org/address/0x6B78be0808262b1d5E9B1eeDfE448aDCE2C637a8)
|
|
7
|
+
*/
|
|
8
|
+
export const buySupplyWithSwapRouterHookABI = [
|
|
9
|
+
{
|
|
10
|
+
type: 'constructor',
|
|
11
|
+
inputs: [
|
|
12
|
+
{
|
|
13
|
+
name: '_factory',
|
|
14
|
+
internalType: 'contract IZoraFactory',
|
|
15
|
+
type: 'address',
|
|
16
|
+
},
|
|
17
|
+
{ name: '_swapRouter', internalType: 'address', type: 'address' },
|
|
18
|
+
],
|
|
19
|
+
stateMutability: 'nonpayable',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 'function',
|
|
23
|
+
inputs: [
|
|
24
|
+
{ name: 'sender', internalType: 'address', type: 'address' },
|
|
25
|
+
{ name: 'coin', internalType: 'contract ICoin', type: 'address' },
|
|
26
|
+
{ name: 'hookData', internalType: 'bytes', type: 'bytes' },
|
|
27
|
+
],
|
|
28
|
+
name: 'afterCoinDeploy',
|
|
29
|
+
outputs: [{ name: '', internalType: 'bytes', type: 'bytes' }],
|
|
30
|
+
stateMutability: 'payable',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'function',
|
|
34
|
+
inputs: [],
|
|
35
|
+
name: 'factory',
|
|
36
|
+
outputs: [
|
|
37
|
+
{ name: '', internalType: 'contract IZoraFactory', type: 'address' },
|
|
38
|
+
],
|
|
39
|
+
stateMutability: 'view',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: 'function',
|
|
43
|
+
inputs: [{ name: 'interfaceId', internalType: 'bytes4', type: 'bytes4' }],
|
|
44
|
+
name: 'supportsInterface',
|
|
45
|
+
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
|
|
46
|
+
stateMutability: 'pure',
|
|
47
|
+
},
|
|
48
|
+
{ type: 'error', inputs: [], name: 'AddressZero' },
|
|
49
|
+
{
|
|
50
|
+
type: 'error',
|
|
51
|
+
inputs: [{ name: 'balance', internalType: 'uint256', type: 'uint256' }],
|
|
52
|
+
name: 'CoinBalanceNot0',
|
|
53
|
+
},
|
|
54
|
+
{ type: 'error', inputs: [], name: 'Erc20NotReceived' },
|
|
55
|
+
{ type: 'error', inputs: [], name: 'HookNotImplemented' },
|
|
56
|
+
{ type: 'error', inputs: [], name: 'InvalidSwapRouterCall' },
|
|
57
|
+
{ type: 'error', inputs: [], name: 'NotFactory' },
|
|
58
|
+
{
|
|
59
|
+
type: 'error',
|
|
60
|
+
inputs: [{ name: 'error', internalType: 'bytes', type: 'bytes' }],
|
|
61
|
+
name: 'SwapReverted',
|
|
62
|
+
},
|
|
63
|
+
] as const
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* [__View Contract on Base Sepolia Basescan__](https://sepolia.basescan.org/address/0x6B78be0808262b1d5E9B1eeDfE448aDCE2C637a8)
|
|
67
|
+
*/
|
|
68
|
+
export const buySupplyWithSwapRouterHookAddress = {
|
|
69
|
+
84532: '0x6B78be0808262b1d5E9B1eeDfE448aDCE2C637a8',
|
|
70
|
+
} as const
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* [__View Contract on Base Sepolia Basescan__](https://sepolia.basescan.org/address/0x6B78be0808262b1d5E9B1eeDfE448aDCE2C637a8)
|
|
74
|
+
*/
|
|
75
|
+
export const buySupplyWithSwapRouterHookConfig = {
|
|
76
|
+
address: buySupplyWithSwapRouterHookAddress,
|
|
77
|
+
abi: buySupplyWithSwapRouterHookABI,
|
|
78
|
+
} as const
|
|
79
|
+
|
|
1
80
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
2
81
|
// CallerAndCommenter
|
|
3
82
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -2106,6 +2185,20 @@ export const coinFactoryABI = [
|
|
|
2106
2185
|
outputs: [{ name: '', internalType: 'address', type: 'address' }],
|
|
2107
2186
|
stateMutability: 'view',
|
|
2108
2187
|
},
|
|
2188
|
+
{
|
|
2189
|
+
type: 'function',
|
|
2190
|
+
inputs: [],
|
|
2191
|
+
name: 'contractName',
|
|
2192
|
+
outputs: [{ name: '', internalType: 'string', type: 'string' }],
|
|
2193
|
+
stateMutability: 'pure',
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
type: 'function',
|
|
2197
|
+
inputs: [],
|
|
2198
|
+
name: 'contractVersion',
|
|
2199
|
+
outputs: [{ name: '', internalType: 'string', type: 'string' }],
|
|
2200
|
+
stateMutability: 'pure',
|
|
2201
|
+
},
|
|
2109
2202
|
{
|
|
2110
2203
|
type: 'function',
|
|
2111
2204
|
inputs: [
|
|
@@ -2145,6 +2238,26 @@ export const coinFactoryABI = [
|
|
|
2145
2238
|
],
|
|
2146
2239
|
stateMutability: 'payable',
|
|
2147
2240
|
},
|
|
2241
|
+
{
|
|
2242
|
+
type: 'function',
|
|
2243
|
+
inputs: [
|
|
2244
|
+
{ name: 'payoutRecipient', internalType: 'address', type: 'address' },
|
|
2245
|
+
{ name: 'owners', internalType: 'address[]', type: 'address[]' },
|
|
2246
|
+
{ name: 'uri', internalType: 'string', type: 'string' },
|
|
2247
|
+
{ name: 'name', internalType: 'string', type: 'string' },
|
|
2248
|
+
{ name: 'symbol', internalType: 'string', type: 'string' },
|
|
2249
|
+
{ name: 'poolConfig', internalType: 'bytes', type: 'bytes' },
|
|
2250
|
+
{ name: 'platformReferrer', internalType: 'address', type: 'address' },
|
|
2251
|
+
{ name: 'hook', internalType: 'address', type: 'address' },
|
|
2252
|
+
{ name: 'hookData', internalType: 'bytes', type: 'bytes' },
|
|
2253
|
+
],
|
|
2254
|
+
name: 'deployWithHook',
|
|
2255
|
+
outputs: [
|
|
2256
|
+
{ name: 'coin', internalType: 'address', type: 'address' },
|
|
2257
|
+
{ name: 'hookDataOut', internalType: 'bytes', type: 'bytes' },
|
|
2258
|
+
],
|
|
2259
|
+
stateMutability: 'payable',
|
|
2260
|
+
},
|
|
2148
2261
|
{
|
|
2149
2262
|
type: 'function',
|
|
2150
2263
|
inputs: [],
|
|
@@ -2323,6 +2436,7 @@ export const coinFactoryABI = [
|
|
|
2323
2436
|
{ type: 'error', inputs: [], name: 'ERC20TransferAmountMismatch' },
|
|
2324
2437
|
{ type: 'error', inputs: [], name: 'EthTransferInvalid' },
|
|
2325
2438
|
{ type: 'error', inputs: [], name: 'FailedInnerCall' },
|
|
2439
|
+
{ type: 'error', inputs: [], name: 'InvalidHook' },
|
|
2326
2440
|
{ type: 'error', inputs: [], name: 'InvalidInitialization' },
|
|
2327
2441
|
{ type: 'error', inputs: [], name: 'NotInitializing' },
|
|
2328
2442
|
{
|
|
@@ -2347,6 +2461,14 @@ export const coinFactoryABI = [
|
|
|
2347
2461
|
inputs: [{ name: 'slot', internalType: 'bytes32', type: 'bytes32' }],
|
|
2348
2462
|
name: 'UUPSUnsupportedProxiableUUID',
|
|
2349
2463
|
},
|
|
2464
|
+
{
|
|
2465
|
+
type: 'error',
|
|
2466
|
+
inputs: [
|
|
2467
|
+
{ name: 'currentName', internalType: 'string', type: 'string' },
|
|
2468
|
+
{ name: 'newName', internalType: 'string', type: 'string' },
|
|
2469
|
+
],
|
|
2470
|
+
name: 'UpgradeToMismatchedContractName',
|
|
2471
|
+
},
|
|
2350
2472
|
] as const
|
|
2351
2473
|
|
|
2352
2474
|
/**
|
|
@@ -7379,6 +7501,29 @@ export const sponsoredSparksSpenderConfig = {
|
|
|
7379
7501
|
* - [__View Contract on Zora Sepolia Zora Sepolia Explorer__](https://sepolia.explorer.zora.energy//address/0x6B36d761981d82B1e07cF3c4daF4cB4615c4850a)
|
|
7380
7502
|
*/
|
|
7381
7503
|
export const uniswapV3SwapRouterABI = [
|
|
7504
|
+
{
|
|
7505
|
+
type: 'function',
|
|
7506
|
+
inputs: [
|
|
7507
|
+
{
|
|
7508
|
+
name: 'params',
|
|
7509
|
+
internalType: 'struct ISwapRouter.ExactInputParams',
|
|
7510
|
+
type: 'tuple',
|
|
7511
|
+
components: [
|
|
7512
|
+
{ name: 'path', internalType: 'bytes', type: 'bytes' },
|
|
7513
|
+
{ name: 'recipient', internalType: 'address', type: 'address' },
|
|
7514
|
+
{ name: 'amountIn', internalType: 'uint256', type: 'uint256' },
|
|
7515
|
+
{
|
|
7516
|
+
name: 'amountOutMinimum',
|
|
7517
|
+
internalType: 'uint256',
|
|
7518
|
+
type: 'uint256',
|
|
7519
|
+
},
|
|
7520
|
+
],
|
|
7521
|
+
},
|
|
7522
|
+
],
|
|
7523
|
+
name: 'exactInput',
|
|
7524
|
+
outputs: [{ name: 'amountOut', internalType: 'uint256', type: 'uint256' }],
|
|
7525
|
+
stateMutability: 'payable',
|
|
7526
|
+
},
|
|
7382
7527
|
{
|
|
7383
7528
|
type: 'function',
|
|
7384
7529
|
inputs: [
|
|
@@ -7409,6 +7554,25 @@ export const uniswapV3SwapRouterABI = [
|
|
|
7409
7554
|
outputs: [{ name: 'amountOut', internalType: 'uint256', type: 'uint256' }],
|
|
7410
7555
|
stateMutability: 'payable',
|
|
7411
7556
|
},
|
|
7557
|
+
{
|
|
7558
|
+
type: 'function',
|
|
7559
|
+
inputs: [
|
|
7560
|
+
{
|
|
7561
|
+
name: 'params',
|
|
7562
|
+
internalType: 'struct ISwapRouter.ExactOutputParams',
|
|
7563
|
+
type: 'tuple',
|
|
7564
|
+
components: [
|
|
7565
|
+
{ name: 'path', internalType: 'bytes', type: 'bytes' },
|
|
7566
|
+
{ name: 'recipient', internalType: 'address', type: 'address' },
|
|
7567
|
+
{ name: 'amountOut', internalType: 'uint256', type: 'uint256' },
|
|
7568
|
+
{ name: 'amountInMaximum', internalType: 'uint256', type: 'uint256' },
|
|
7569
|
+
],
|
|
7570
|
+
},
|
|
7571
|
+
],
|
|
7572
|
+
name: 'exactOutput',
|
|
7573
|
+
outputs: [{ name: 'amountIn', internalType: 'uint256', type: 'uint256' }],
|
|
7574
|
+
stateMutability: 'payable',
|
|
7575
|
+
},
|
|
7412
7576
|
{
|
|
7413
7577
|
type: 'function',
|
|
7414
7578
|
inputs: [
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Zora Labs
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|