@zoralabs/protocol-deployments 0.0.12 → 0.0.14-MINT.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 +17 -18
- package/CHANGELOG.md +19 -0
- package/README.md +2 -8
- package/dist/{package/chainConfigs.d.ts → chainConfigs.d.ts} +4 -3
- package/dist/chainConfigs.d.ts.map +1 -0
- package/dist/deployment.d.ts.map +1 -0
- package/dist/index.cjs +88 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -53
- package/dist/index.js.map +1 -1
- package/dist/{package/wagmiGenerated.d.ts → wagmiGenerated.d.ts} +118 -44
- package/dist/{package/wagmiGenerated.d.ts.map → wagmiGenerated.d.ts.map} +1 -1
- package/package.json +10 -22
- package/{script → scripts}/bundle-chainConfigs.mjs +9 -7
- package/src/chainConfigs.ts +62 -0
- package/{package → src}/wagmiGenerated.ts +72 -36
- package/tsconfig.json +1 -1
- package/tsup.config.ts +5 -5
- package/wagmi.config.ts +31 -9
- package/.env.anvil +0 -2
- package/addresses/1.json +0 -13
- package/addresses/10.json +0 -13
- package/addresses/11155111.json +0 -13
- package/addresses/420.json +0 -13
- package/addresses/424.json +0 -11
- package/addresses/5.json +0 -14
- package/addresses/58008.json +0 -11
- package/addresses/7777777.json +0 -13
- package/addresses/8453.json +0 -13
- package/addresses/84531.json +0 -14
- package/addresses/999.json +0 -13
- package/addresses/999999999.json +0 -14
- package/chainConfigs/1.json +0 -5
- package/chainConfigs/10.json +0 -5
- package/chainConfigs/11155111.json +0 -5
- package/chainConfigs/420.json +0 -5
- package/chainConfigs/424.json +0 -5
- package/chainConfigs/5.json +0 -5
- package/chainConfigs/58008.json +0 -4
- package/chainConfigs/7777777.json +0 -5
- package/chainConfigs/8453.json +0 -5
- package/chainConfigs/84531.json +0 -5
- package/chainConfigs/999.json +0 -5
- package/chainConfigs/999999999.json +0 -5
- package/deterministicConfig/factoryProxy/params.json +0 -10
- package/deterministicConfig/factoryProxy/signatures.json +0 -14
- package/deterministicConfig/premintExecutorProxy/params.json +0 -10
- package/deterministicConfig/premintExecutorProxy/signatures.json +0 -12
- package/deterministicConfig/upgradeGate/params.json +0 -7
- package/deterministicConfig/upgradeGate/signatures.json +0 -14
- package/dist/package/batchPublish.test.d.ts +0 -452
- package/dist/package/batchPublish.test.d.ts.map +0 -1
- package/dist/package/chainConfigs.d.ts.map +0 -1
- package/dist/package/deployment.d.ts.map +0 -1
- package/dist/package/index.d.ts.map +0 -1
- package/dist/script/copy-deployed-contracts.d.ts +0 -2
- package/dist/script/copy-deployed-contracts.d.ts.map +0 -1
- package/dist/script/signDeploymentTransactions.d.ts +0 -2
- package/dist/script/signDeploymentTransactions.d.ts.map +0 -1
- package/foundry.toml +0 -41
- package/package/batchPublish.test.ts +0 -327
- package/remappings.txt +0 -9
- package/script/CalculateDeterministicParams.s.sol +0 -84
- package/script/DeployMintersAndImplementations.s.sol +0 -29
- package/script/DeployNew1155Impl.s.sol +0 -24
- package/script/DeployNewImplementation.s.sol +0 -26
- package/script/DeployPreminterImpl.s.sol +0 -23
- package/script/DeployProxiesToNewChain.s.sol +0 -50
- package/script/DeployTestContracts.s.sol +0 -35
- package/script/DeployUpgradeGate.s.sol +0 -27
- package/script/Upgrade.s.sol +0 -83
- package/script/UpgradePreminter.s.sol +0 -34
- package/script/copy-deployed-contracts.ts +0 -86
- package/script/signDeploymentTransactions.ts +0 -302
- package/src/DeploymentConfig.sol +0 -124
- package/src/DeploymentTestingUtils.sol +0 -166
- package/src/DeterministicDeployerScript.sol +0 -249
- package/src/DeterministicProxyDeployer.sol +0 -139
- package/src/IImmutableCreate2Factory.sol +0 -59
- package/src/Zora1155PremintFixtures.sol +0 -75
- package/src/ZoraDeployerBase.sol +0 -144
- package/src/ZoraDeployerUtils.sol +0 -212
- package/test/NewFactoryProxyDeployer.t.sol +0 -127
- package/test/UpgradesTest.t.sol +0 -222
- package/test/ZoraCreator1155Factory_Fork.t.sol +0 -149
- package/test/ZoraCreator1155PremintExecutorForkTest.t.sol +0 -205
- /package/dist/{package/deployment.d.ts → deployment.d.ts} +0 -0
- /package/dist/{package/index.d.ts → index.d.ts} +0 -0
- /package/{package → src}/deployment.ts +0 -0
- /package/{package → src}/index.ts +0 -0
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
http,
|
|
3
|
-
createWalletClient,
|
|
4
|
-
createPublicClient,
|
|
5
|
-
encodeFunctionData,
|
|
6
|
-
TransactionReceipt,
|
|
7
|
-
decodeEventLog,
|
|
8
|
-
encodeAbiParameters,
|
|
9
|
-
parseEther,
|
|
10
|
-
createTestClient,
|
|
11
|
-
} from "viem";
|
|
12
|
-
import { foundry, zora } from "viem/chains";
|
|
13
|
-
import { describe, it, expect } from "vitest";
|
|
14
|
-
import {
|
|
15
|
-
zoraCreator1155FactoryImplConfig,
|
|
16
|
-
zoraCreatorFixedPriceSaleStrategyABI,
|
|
17
|
-
} from "./wagmiGenerated";
|
|
18
|
-
import { zoraCreator1155ImplABI } from "@zoralabs/zora-1155-contracts";
|
|
19
|
-
|
|
20
|
-
const walletClient = createWalletClient({
|
|
21
|
-
chain: foundry,
|
|
22
|
-
transport: http(),
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const walletClientWithAccount = createWalletClient({
|
|
26
|
-
chain: foundry,
|
|
27
|
-
transport: http(),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const testClient = createTestClient({
|
|
31
|
-
chain: foundry,
|
|
32
|
-
mode: "anvil",
|
|
33
|
-
transport: http(),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const publicClient = createPublicClient({
|
|
37
|
-
chain: foundry,
|
|
38
|
-
transport: http(),
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
type Address = `0x${string}`;
|
|
42
|
-
|
|
43
|
-
// JSON-RPC Account
|
|
44
|
-
const [creatorAccount, collectorAccount] =
|
|
45
|
-
(await walletClient.getAddresses()) as [Address, Address, Address];
|
|
46
|
-
|
|
47
|
-
const factoryProxyAddress = zoraCreator1155FactoryImplConfig.address[
|
|
48
|
-
zora.id
|
|
49
|
-
].toLowerCase() as `0x${string}`;
|
|
50
|
-
|
|
51
|
-
const AddressZero = "0x0000000000000000000000000000000000000000";
|
|
52
|
-
|
|
53
|
-
type CreateTokenParams = {
|
|
54
|
-
fixedPriceStrategyAddress: `0x${string}`;
|
|
55
|
-
maxSupply: bigint;
|
|
56
|
-
nextTokenId: bigint;
|
|
57
|
-
price: bigint;
|
|
58
|
-
saleEnd?: bigint;
|
|
59
|
-
saleStart?: bigint;
|
|
60
|
-
mintLimit?: bigint;
|
|
61
|
-
tokenURI: string;
|
|
62
|
-
royaltyBPS: number;
|
|
63
|
-
royaltyRecipient: `0x${string}`;
|
|
64
|
-
autoSupplyInterval: number;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
function constructCreate1155Calls({
|
|
68
|
-
fixedPriceStrategyAddress,
|
|
69
|
-
maxSupply,
|
|
70
|
-
mintLimit,
|
|
71
|
-
nextTokenId,
|
|
72
|
-
price,
|
|
73
|
-
saleEnd,
|
|
74
|
-
saleStart,
|
|
75
|
-
tokenURI,
|
|
76
|
-
royaltyBPS,
|
|
77
|
-
royaltyRecipient,
|
|
78
|
-
autoSupplyInterval,
|
|
79
|
-
}: CreateTokenParams): `0x${string}`[] {
|
|
80
|
-
if (!royaltyRecipient) {
|
|
81
|
-
royaltyRecipient = AddressZero;
|
|
82
|
-
autoSupplyInterval = 0;
|
|
83
|
-
}
|
|
84
|
-
const verifyTokenIdExpected = encodeFunctionData({
|
|
85
|
-
abi: zoraCreator1155ImplABI,
|
|
86
|
-
functionName: "assumeLastTokenIdMatches",
|
|
87
|
-
args: [nextTokenId - 1n],
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const setupNewToken = encodeFunctionData({
|
|
91
|
-
abi: zoraCreator1155ImplABI,
|
|
92
|
-
functionName: "setupNewToken",
|
|
93
|
-
args: [tokenURI, maxSupply],
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
let royaltyConfig = null;
|
|
97
|
-
if (royaltyBPS > 0 && royaltyRecipient != AddressZero) {
|
|
98
|
-
royaltyConfig = encodeFunctionData({
|
|
99
|
-
abi: zoraCreator1155ImplABI,
|
|
100
|
-
functionName: "updateRoyaltiesForToken",
|
|
101
|
-
args: [
|
|
102
|
-
nextTokenId,
|
|
103
|
-
{
|
|
104
|
-
royaltyBPS,
|
|
105
|
-
royaltyRecipient,
|
|
106
|
-
royaltyMintSchedule: autoSupplyInterval,
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const contractCalls = [
|
|
113
|
-
verifyTokenIdExpected,
|
|
114
|
-
setupNewToken,
|
|
115
|
-
royaltyConfig,
|
|
116
|
-
].filter((item) => item !== null) as `0x${string}`[];
|
|
117
|
-
|
|
118
|
-
if (typeof price !== "undefined") {
|
|
119
|
-
const fixedPriceApproval = encodeFunctionData({
|
|
120
|
-
abi: zoraCreator1155ImplABI,
|
|
121
|
-
functionName: "addPermission",
|
|
122
|
-
args: [
|
|
123
|
-
nextTokenId,
|
|
124
|
-
fixedPriceStrategyAddress,
|
|
125
|
-
2n ** 2n, // PERMISSION_BIT_MINTER
|
|
126
|
-
],
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const saleData = encodeFunctionData({
|
|
130
|
-
abi: zoraCreatorFixedPriceSaleStrategyABI,
|
|
131
|
-
functionName: "setSale",
|
|
132
|
-
args: [
|
|
133
|
-
nextTokenId,
|
|
134
|
-
{
|
|
135
|
-
pricePerToken: price,
|
|
136
|
-
saleStart: saleStart || 0n,
|
|
137
|
-
saleEnd: saleEnd || 0n,
|
|
138
|
-
maxTokensPerAddress: mintLimit || 0n,
|
|
139
|
-
fundsRecipient: AddressZero,
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
const callSale = encodeFunctionData({
|
|
145
|
-
abi: zoraCreator1155ImplABI,
|
|
146
|
-
functionName: "callSale",
|
|
147
|
-
args: [nextTokenId, fixedPriceStrategyAddress, saleData],
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
return [...contractCalls, fixedPriceApproval, callSale] as `0x${string}`[];
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return contractCalls;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function parseCreate1155Receipt(receipt: TransactionReceipt): {
|
|
157
|
-
contractAddress?: `0x${string}`;
|
|
158
|
-
tokenId?: bigint;
|
|
159
|
-
} {
|
|
160
|
-
const parsedLog = receipt.logs
|
|
161
|
-
.map((log) => {
|
|
162
|
-
try {
|
|
163
|
-
return decodeEventLog({
|
|
164
|
-
abi: zoraCreator1155ImplABI,
|
|
165
|
-
...log,
|
|
166
|
-
});
|
|
167
|
-
} catch (e) {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
})
|
|
171
|
-
.filter(Boolean);
|
|
172
|
-
|
|
173
|
-
const updatedTokenEvents = parsedLog.filter(
|
|
174
|
-
(log) => log?.eventName === "UpdatedToken",
|
|
175
|
-
);
|
|
176
|
-
const lastUpdatedTokenEvent =
|
|
177
|
-
updatedTokenEvents[updatedTokenEvents.length - 1];
|
|
178
|
-
|
|
179
|
-
let tokenId;
|
|
180
|
-
let contractAddress;
|
|
181
|
-
|
|
182
|
-
// @ts-ignore
|
|
183
|
-
if (lastUpdatedTokenEvent?.args?.tokenId) {
|
|
184
|
-
// @ts-ignore
|
|
185
|
-
tokenId = lastUpdatedTokenEvent?.args?.tokenId as bigint;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// @ts-ignore
|
|
189
|
-
if (receipt.logs?.[0].address) {
|
|
190
|
-
contractAddress = receipt.logs?.[0].address as `0x${string}`;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return { tokenId, contractAddress };
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
describe("Zora1155", () => {
|
|
197
|
-
it(
|
|
198
|
-
"can batch publish tokens",
|
|
199
|
-
async () => {
|
|
200
|
-
const fixedPriceMinterAddress = await publicClient.readContract({
|
|
201
|
-
abi: zoraCreator1155FactoryImplConfig.abi,
|
|
202
|
-
address: factoryProxyAddress,
|
|
203
|
-
functionName: "fixedPriceMinter",
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
const contractAdmin = creatorAccount;
|
|
207
|
-
const contractUri = "ipfs://contracturl";
|
|
208
|
-
const contractName = "my contract";
|
|
209
|
-
|
|
210
|
-
// setup token creation parameters, assuming that
|
|
211
|
-
// they have auto incrementing ids
|
|
212
|
-
const createToken1Params: CreateTokenParams = {
|
|
213
|
-
maxSupply: 100n,
|
|
214
|
-
mintLimit: 100n,
|
|
215
|
-
nextTokenId: 1n,
|
|
216
|
-
tokenURI: "ipfs://token1",
|
|
217
|
-
fixedPriceStrategyAddress: fixedPriceMinterAddress,
|
|
218
|
-
autoSupplyInterval: 10,
|
|
219
|
-
price: parseEther("0.05"),
|
|
220
|
-
royaltyBPS: 10,
|
|
221
|
-
royaltyRecipient: creatorAccount,
|
|
222
|
-
saleStart: 0n,
|
|
223
|
-
saleEnd: 10000000000000n,
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
const createToken2Params: CreateTokenParams = {
|
|
227
|
-
...createToken1Params,
|
|
228
|
-
tokenURI: "ipfs://token2",
|
|
229
|
-
nextTokenId: 2n,
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
const createToken3Params: CreateTokenParams = {
|
|
233
|
-
...createToken1Params,
|
|
234
|
-
tokenURI: "ipfs://token3",
|
|
235
|
-
nextTokenId: 3n,
|
|
236
|
-
price: parseEther("0.0001"),
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
// build setup actions to create tokens when contract is created
|
|
240
|
-
const setupActions = [
|
|
241
|
-
...constructCreate1155Calls(createToken1Params),
|
|
242
|
-
...constructCreate1155Calls(createToken2Params),
|
|
243
|
-
...constructCreate1155Calls(createToken3Params),
|
|
244
|
-
];
|
|
245
|
-
|
|
246
|
-
// have the factory create the contract
|
|
247
|
-
const createContractCall = await walletClient.writeContract({
|
|
248
|
-
abi: zoraCreator1155FactoryImplConfig.abi,
|
|
249
|
-
address: zoraCreator1155FactoryImplConfig.address[zora.id],
|
|
250
|
-
functionName: "createContract",
|
|
251
|
-
args: [
|
|
252
|
-
contractUri,
|
|
253
|
-
contractName,
|
|
254
|
-
{
|
|
255
|
-
royaltyBPS: 10,
|
|
256
|
-
royaltyMintSchedule: 5,
|
|
257
|
-
royaltyRecipient: creatorAccount,
|
|
258
|
-
},
|
|
259
|
-
contractAdmin,
|
|
260
|
-
setupActions,
|
|
261
|
-
],
|
|
262
|
-
account: creatorAccount,
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
const receipt = await publicClient.waitForTransactionReceipt({
|
|
266
|
-
hash: createContractCall,
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
expect(receipt.status).toBe("success");
|
|
270
|
-
|
|
271
|
-
// parse the receipt to get the contract address and last token id
|
|
272
|
-
const { contractAddress, tokenId: lastTokenId } =
|
|
273
|
-
parseCreate1155Receipt(receipt);
|
|
274
|
-
|
|
275
|
-
// now try to mint a token
|
|
276
|
-
const quantityToMint = 2n;
|
|
277
|
-
|
|
278
|
-
const encodedParams = encodeAbiParameters(
|
|
279
|
-
[{ type: "address", name: "address" }],
|
|
280
|
-
[collectorAccount],
|
|
281
|
-
);
|
|
282
|
-
|
|
283
|
-
const zoraMintFee = parseEther("0.000777");
|
|
284
|
-
|
|
285
|
-
const valueToSend =
|
|
286
|
-
(BigInt(zoraMintFee) + createToken3Params.price) * quantityToMint;
|
|
287
|
-
|
|
288
|
-
// make sure the collector has enough balance
|
|
289
|
-
await testClient.setBalance({
|
|
290
|
-
address: collectorAccount,
|
|
291
|
-
value: parseEther("100"),
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
const mintCall = await walletClient.writeContract({
|
|
295
|
-
abi: zoraCreator1155ImplABI,
|
|
296
|
-
address: contractAddress!,
|
|
297
|
-
functionName: "mint",
|
|
298
|
-
account: collectorAccount,
|
|
299
|
-
args: [
|
|
300
|
-
fixedPriceMinterAddress,
|
|
301
|
-
lastTokenId!,
|
|
302
|
-
quantityToMint,
|
|
303
|
-
[AddressZero, AddressZero],
|
|
304
|
-
encodedParams,
|
|
305
|
-
],
|
|
306
|
-
value: valueToSend,
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
expect(
|
|
310
|
-
(await publicClient.waitForTransactionReceipt({ hash: mintCall }))
|
|
311
|
-
.status,
|
|
312
|
-
).toBe("success");
|
|
313
|
-
|
|
314
|
-
// check balance of token
|
|
315
|
-
const tokenBalance = await publicClient.readContract({
|
|
316
|
-
abi: zoraCreator1155ImplABI,
|
|
317
|
-
address: contractAddress!,
|
|
318
|
-
functionName: "balanceOf",
|
|
319
|
-
args: [collectorAccount, lastTokenId!],
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
expect(tokenBalance).toBe(quantityToMint);
|
|
323
|
-
},
|
|
324
|
-
// 10 second timeout
|
|
325
|
-
10 * 1000,
|
|
326
|
-
);
|
|
327
|
-
});
|
package/remappings.txt
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
ds-test/=node_modules/ds-test/src/
|
|
2
|
-
forge-std/=node_modules/forge-std/src/
|
|
3
|
-
@zoralabs/openzeppelin-contracts-upgradeable/=node_modules/@zoralabs/openzeppelin-contracts-upgradeable/
|
|
4
|
-
@zoralabs/protocol-rewards/src/=node_modules/@zoralabs/protocol-rewards/src/
|
|
5
|
-
@zoralabs/zora-1155-contracts/src/=node_modules/@zoralabs/zora-1155-contracts/src/
|
|
6
|
-
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
|
|
7
|
-
_imagine=node_modules/@zoralabs/zora-1155-contracts/_imagine
|
|
8
|
-
solemate/=/node_modules/solemate/src/
|
|
9
|
-
solady/=node_modules/solady/src/
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// spdx-license-identifier: mit
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Zora1155Factory} from "@zoralabs/zora-1155-contracts/src/proxies/Zora1155Factory.sol";
|
|
9
|
-
import {ProxyShim} from "@zoralabs/zora-1155-contracts/src/utils/ProxyShim.sol";
|
|
10
|
-
import {UpgradeGate} from "@zoralabs/zora-1155-contracts/src/upgrades/UpgradeGate.sol";
|
|
11
|
-
import {LibString} from "solady/utils/LibString.sol";
|
|
12
|
-
import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
|
|
13
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
14
|
-
import {Zora1155PremintExecutor} from "@zoralabs/zora-1155-contracts/src/proxies/Zora1155PremintExecutor.sol";
|
|
15
|
-
import {DeterministicDeployerScript, DeterministicParams} from "../src/DeterministicDeployerScript.sol";
|
|
16
|
-
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
|
|
17
|
-
|
|
18
|
-
/// @title Gets parameters for deterministically deploying a new 1155 factory proxy at an address starting with 0x777777, regardless of the chain.
|
|
19
|
-
/// @dev Example usage: DEPLOYER=0xf69fEc6d858c77e969509843852178bd24CAd2B6 forge script script/GetDeterminsticParam.s.sol --rpc-url https://testnet.rpc.zora.energy --ffi
|
|
20
|
-
/// @author doved
|
|
21
|
-
/// @notice Ensure to set env variable for DEPLOYER
|
|
22
|
-
contract FactoryProxyDeterministicParams is ZoraDeployerBase {
|
|
23
|
-
address deployerAddress;
|
|
24
|
-
// Set in step 2
|
|
25
|
-
address proxyDeployerAddress;
|
|
26
|
-
|
|
27
|
-
function run() public {
|
|
28
|
-
vm.createSelectFork("zora_goerli", 1252119);
|
|
29
|
-
|
|
30
|
-
deployerAddress = vm.envAddress("TURNKEY_TARGET_ADDRESS");
|
|
31
|
-
|
|
32
|
-
calculateForFactoryProxy();
|
|
33
|
-
calculateForPremintExecutorProxy();
|
|
34
|
-
|
|
35
|
-
// Note: relies on proxyDeployerAddress
|
|
36
|
-
calculateUpgradeGateAddress();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function calculateForFactoryProxy() internal {
|
|
40
|
-
bytes memory proxyCreationCode = type(Zora1155Factory).creationCode;
|
|
41
|
-
|
|
42
|
-
DeterministicParams memory deterministicParams = getDeterministicDeploymentParams(deployerAddress, proxyCreationCode, 100);
|
|
43
|
-
|
|
44
|
-
proxyDeployerAddress = deterministicParams.proxyDeployerAddress;
|
|
45
|
-
|
|
46
|
-
mkdir("deterministicConfig/factoryProxy");
|
|
47
|
-
serializeAndSaveOutput(deterministicParams, "factoryProxy");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function calculateForPremintExecutorProxy() internal {
|
|
51
|
-
bytes memory proxyCreationCode = type(Zora1155PremintExecutor).creationCode;
|
|
52
|
-
|
|
53
|
-
DeterministicParams memory deterministicParams = getDeterministicDeploymentParams(deployerAddress, proxyCreationCode, 200);
|
|
54
|
-
|
|
55
|
-
mkdir("deterministicConfig/premintExecutorProxy");
|
|
56
|
-
serializeAndSaveOutput(deterministicParams, "premintExecutorProxy");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// @notice Since this doesn't
|
|
60
|
-
function calculateUpgradeGateAddress() internal {
|
|
61
|
-
bytes memory creationCodeUpgradeGate = type(UpgradeGate).creationCode;
|
|
62
|
-
bytes32 salt = saltWithAddressInFirst20Bytes(deployerAddress, 20);
|
|
63
|
-
address resultAddress = Create2.computeAddress(salt, keccak256(creationCodeUpgradeGate), proxyDeployerAddress);
|
|
64
|
-
|
|
65
|
-
vm.serializeAddress("UPGRADE_GATE_JSON", "deployerAddress", deployerAddress);
|
|
66
|
-
vm.serializeAddress("UPGRADE_GATE_JSON", "upgradeGateAddress", resultAddress);
|
|
67
|
-
vm.serializeAddress("UPGRADE_GATE_JSON", "proxyDeployerAddress", proxyDeployerAddress);
|
|
68
|
-
vm.serializeBytes32("UPGRADE_GATE_JSON", "salt", salt);
|
|
69
|
-
string memory output = vm.serializeBytes("UPGRADE_GATE_JSON", "creationCode", creationCodeUpgradeGate);
|
|
70
|
-
|
|
71
|
-
console2.log(output);
|
|
72
|
-
|
|
73
|
-
mkdir("deterministicConfig/upgradeGate");
|
|
74
|
-
vm.writeJson(output, paramsFilePath("upgradeGate"));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function mkdir(string memory path) internal {
|
|
78
|
-
string[] memory commands = new string[](3);
|
|
79
|
-
commands[0] = "mkdir";
|
|
80
|
-
commands[1] = "-p";
|
|
81
|
-
commands[2] = path;
|
|
82
|
-
vm.ffi(commands);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
9
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
10
|
-
|
|
11
|
-
contract DeployMintersAndImplementations is ZoraDeployerBase {
|
|
12
|
-
function run() public returns (string memory) {
|
|
13
|
-
Deployment memory deployment = getDeployment();
|
|
14
|
-
|
|
15
|
-
address deployer = vm.envAddress("DEPLOYER");
|
|
16
|
-
|
|
17
|
-
vm.startBroadcast(deployer);
|
|
18
|
-
|
|
19
|
-
deployMinters(deployment);
|
|
20
|
-
|
|
21
|
-
deployNew1155AndFactoryImpl(deployment);
|
|
22
|
-
|
|
23
|
-
deployNewPreminterImplementationDeterminstic(deployment);
|
|
24
|
-
|
|
25
|
-
vm.stopBroadcast();
|
|
26
|
-
|
|
27
|
-
return getDeploymentJSON(deployment);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";
|
|
10
|
-
|
|
11
|
-
/// @dev Deploys implementation contracts for 1155 contracts.
|
|
12
|
-
/// @notice Run after deploying the minters
|
|
13
|
-
/// @notice This
|
|
14
|
-
contract DeployNewImplementations is ZoraDeployerBase {
|
|
15
|
-
function run() public returns (string memory) {
|
|
16
|
-
Deployment memory deployment = getDeployment();
|
|
17
|
-
|
|
18
|
-
vm.startBroadcast();
|
|
19
|
-
|
|
20
|
-
deployNew1155AndFactoryImpl(deployment);
|
|
21
|
-
|
|
22
|
-
return getDeploymentJSON(deployment);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";
|
|
10
|
-
|
|
11
|
-
/// @dev Deploys implementation contracts for 1155 contracts.
|
|
12
|
-
/// @notice Run after deploying the minters
|
|
13
|
-
/// @notice This
|
|
14
|
-
contract DeployNewImplementations is ZoraDeployerBase {
|
|
15
|
-
function run() public returns (string memory) {
|
|
16
|
-
Deployment memory deployment = getDeployment();
|
|
17
|
-
|
|
18
|
-
vm.startBroadcast();
|
|
19
|
-
|
|
20
|
-
deployNew1155AndFactoryImpl(deployment);
|
|
21
|
-
|
|
22
|
-
deployNewPreminterImplementationDeterminstic(deployment);
|
|
23
|
-
|
|
24
|
-
return getDeploymentJSON(deployment);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";
|
|
10
|
-
|
|
11
|
-
/// @dev Deploys preminter implementation contract.
|
|
12
|
-
/// @notice Run after deploying the minters
|
|
13
|
-
contract DeployPreminterImpl is ZoraDeployerBase {
|
|
14
|
-
function run() public returns (string memory) {
|
|
15
|
-
Deployment memory deployment = getDeployment();
|
|
16
|
-
|
|
17
|
-
vm.startBroadcast();
|
|
18
|
-
|
|
19
|
-
deployNewPreminterImplementationDeterminstic(deployment);
|
|
20
|
-
|
|
21
|
-
return getDeploymentJSON(deployment);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
10
|
-
import {DeploymentTestingUtils} from "../src/DeploymentTestingUtils.sol";
|
|
11
|
-
import {IZoraCreator1155PremintExecutor} from "@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155PremintExecutor.sol";
|
|
12
|
-
|
|
13
|
-
contract DeployProxiesToNewChain is ZoraDeployerBase {
|
|
14
|
-
function run() public returns (string memory) {
|
|
15
|
-
Deployment memory deployment = getDeployment();
|
|
16
|
-
|
|
17
|
-
vm.startBroadcast();
|
|
18
|
-
|
|
19
|
-
console.log("deploy factory proxy");
|
|
20
|
-
|
|
21
|
-
deployFactoryProxyDeterminstic(deployment);
|
|
22
|
-
|
|
23
|
-
console2.log("factory proxy address:", deployment.factoryProxy);
|
|
24
|
-
|
|
25
|
-
console2.log("create test contract for verification");
|
|
26
|
-
|
|
27
|
-
ZoraDeployerUtils.deployTestContractForVerification(deployment.factoryProxy, makeAddr("admin"));
|
|
28
|
-
|
|
29
|
-
deployPreminterProxyDeterminstic(deployment);
|
|
30
|
-
|
|
31
|
-
console2.log("preminter proxy", deployment.preminterProxy);
|
|
32
|
-
|
|
33
|
-
console2.log("testing premint");
|
|
34
|
-
|
|
35
|
-
address fundsRecipient = vm.envAddress("TEST_PREMINT_FUNDS_RECIPIENT");
|
|
36
|
-
IZoraCreator1155PremintExecutor.MintArguments memory mintArguments = IZoraCreator1155PremintExecutor.MintArguments({
|
|
37
|
-
mintRecipient: fundsRecipient,
|
|
38
|
-
mintComment: "",
|
|
39
|
-
mintRewardsRecipients: new address[](0)
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
signAndExecutePremintV2(deployment.preminterProxy, vm.envAddress("TEST_PREMINT_FUNDS_RECIPIENT"), mintArguments);
|
|
43
|
-
|
|
44
|
-
vm.stopBroadcast();
|
|
45
|
-
|
|
46
|
-
// now test signing and executing premint
|
|
47
|
-
|
|
48
|
-
return getDeploymentJSON(deployment);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
10
|
-
import {IZoraCreator1155PremintExecutor} from "@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155PremintExecutor.sol";
|
|
11
|
-
|
|
12
|
-
contract DeployTestContracts is ZoraDeployerBase {
|
|
13
|
-
function run() public returns (string memory) {
|
|
14
|
-
Deployment memory deployment = getDeployment();
|
|
15
|
-
|
|
16
|
-
vm.startBroadcast();
|
|
17
|
-
|
|
18
|
-
ZoraDeployerUtils.deployTestContractForVerification(deployment.factoryProxy, makeAddr("admin"));
|
|
19
|
-
|
|
20
|
-
address fundsRecipient = vm.envAddress("DEPLOYER");
|
|
21
|
-
IZoraCreator1155PremintExecutor.MintArguments memory mintArguments = IZoraCreator1155PremintExecutor.MintArguments({
|
|
22
|
-
mintRecipient: fundsRecipient,
|
|
23
|
-
mintComment: "",
|
|
24
|
-
mintRewardsRecipients: new address[](0)
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
signAndExecutePremintV2(deployment.preminterProxy, fundsRecipient, mintArguments);
|
|
28
|
-
|
|
29
|
-
vm.stopBroadcast();
|
|
30
|
-
|
|
31
|
-
// now test signing and executing premint
|
|
32
|
-
|
|
33
|
-
return getDeploymentJSON(deployment);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "forge-std/Script.sol";
|
|
5
|
-
import "forge-std/console2.sol";
|
|
6
|
-
|
|
7
|
-
import {ZoraDeployerBase} from "../src/ZoraDeployerBase.sol";
|
|
8
|
-
import {Deployment} from "../src/DeploymentConfig.sol";
|
|
9
|
-
import {ZoraDeployerUtils} from "../src/ZoraDeployerUtils.sol";
|
|
10
|
-
import {DeploymentTestingUtils} from "../src/DeploymentTestingUtils.sol";
|
|
11
|
-
import {DeterministicDeployerScript} from "../src/DeterministicDeployerScript.sol";
|
|
12
|
-
|
|
13
|
-
contract DeployUpgradeGate is ZoraDeployerBase {
|
|
14
|
-
function run() public returns (string memory) {
|
|
15
|
-
Deployment memory deployment = getDeployment();
|
|
16
|
-
|
|
17
|
-
vm.startBroadcast();
|
|
18
|
-
|
|
19
|
-
deployUpgradeGateDeterminstic(deployment);
|
|
20
|
-
|
|
21
|
-
vm.stopBroadcast();
|
|
22
|
-
|
|
23
|
-
// now test signing and executing premint
|
|
24
|
-
|
|
25
|
-
return getDeploymentJSON(deployment);
|
|
26
|
-
}
|
|
27
|
-
}
|