Skip to content

Commit 41cc5ee

Browse files
cleanup deploy scripts
1 parent aadf442 commit 41cc5ee

File tree

2 files changed

+52
-10
lines changed

2 files changed

+52
-10
lines changed

hardhat.config.ts

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ const chainIds = {
2525
fantom_testnet: 4002,
2626
polygon: 137,
2727
mumbai: 80001,
28+
optimism: 10,
29+
optimism_testnet: 69,
30+
arbitrum: 42161,
31+
arbitrum_testnet: 421611,
2832
};
2933

3034
// Ensure that we have all the environment variables we need.
@@ -44,14 +48,31 @@ function createTestnetConfig(network: keyof typeof chainIds): NetworkUserConfig
4448
? `https://polygon-${polygonNetworkName}.g.alchemy.com/v2/${alchemyKey}`
4549
: `https://eth-${network}.alchemyapi.io/v2/${alchemyKey}`;
4650

47-
if (network === "avax") {
48-
nodeUrl = "https://api.avax.network/ext/bc/C/rpc";
49-
} else if (network === "avax_testnet") {
50-
nodeUrl = "https://api.avax-test.network/ext/bc/C/rpc";
51-
} else if (network === "fantom") {
52-
nodeUrl = "https://rpc.ftm.tools";
53-
} else if (network === "fantom_testnet") {
54-
nodeUrl = "https://rpc.testnet.fantom.network";
51+
switch (network) {
52+
case "optimism":
53+
nodeUrl = `https://opt-mainnet.g.alchemy.com/v2/${alchemyKey}`;
54+
break;
55+
case "optimism_testnet":
56+
nodeUrl = `https://opt-kovan.g.alchemy.com/v2/${alchemyKey}`;
57+
break;
58+
case "arbitrum":
59+
nodeUrl = `https://arb-mainnet.g.alchemy.com/v2/${alchemyKey}`;
60+
break;
61+
case "arbitrum_testnet":
62+
nodeUrl = `https://arb-rinkeby.g.alchemy.com/v2/${alchemyKey}`;
63+
break;
64+
case "avax":
65+
nodeUrl = "https://api.avax.network/ext/bc/C/rpc";
66+
break;
67+
case "avax_testnet":
68+
nodeUrl = "https://api.avax-test.network/ext/bc/C/rpc";
69+
break;
70+
case "fantom":
71+
nodeUrl = "https://rpc.ftm.tools";
72+
break;
73+
case "fantom_testnet":
74+
nodeUrl = "https://rpc.testnet.fantom.network";
75+
break;
5576
}
5677

5778
return {
@@ -72,8 +93,6 @@ const config: HardhatUserConfig = {
7293
version: "0.8.12",
7394
settings: {
7495
metadata: {
75-
// Not including the metadata hash
76-
// https://github.com/paulrberg/solidity-template/issues/31
7796
bytecodeHash: "ipfs",
7897
},
7998
// You should disable the optimizer when debugging
@@ -104,6 +123,10 @@ const config: HardhatUserConfig = {
104123
ftmTestnet: process.env.FANTOMSCAN_API_KEY || process.env.SCAN_API_KEY,
105124
avalanche: process.env.SNOWTRACE_API_KEY || process.env.SCAN_API_KEY,
106125
avalancheFujiTestnet: process.env.SNOWTRACE_API_KEY || process.env.SCAN_API_KEY,
126+
optimisticEthereum: process.env.OPTIMISM_SCAN_API_KEY || process.env.SCAN_API_KEY,
127+
optimisticKovan: process.env.OPTIMISM_SCAN_API_KEY || process.env.SCAN_API_KEY,
128+
arbitrumOne: process.env.ARBITRUM_SCAN_API_KEY || process.env.SCAN_API_KEY,
129+
arbitrumTestnet: process.env.ARBITRUM_SCAN_API_KEY || process.env.SCAN_API_KEY,
107130
},
108131
},
109132
gasReporter: {
@@ -127,6 +150,10 @@ if (testPrivateKey) {
127150
fantom_testnet: createTestnetConfig("fantom_testnet"),
128151
avax: createTestnetConfig("avax"),
129152
avax_testnet: createTestnetConfig("avax_testnet"),
153+
arbitrum: createTestnetConfig("arbitrum"),
154+
arbitrum_testnet: createTestnetConfig("arbitrum_testnet"),
155+
optimism: createTestnetConfig("optimism"),
156+
optimism_testnet: createTestnetConfig("optimism_testnet"),
130157
};
131158
}
132159

scripts/deploy/fullV2Setup.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import hre, { ethers } from "hardhat";
22

33
import {
44
DropERC1155,
5+
DropERC20,
56
DropERC721,
67
Marketplace,
78
Split,
@@ -36,6 +37,10 @@ async function main() {
3637
43113: "0xd00ae08403B9bbb9124bB305C09058E32C39A48c",
3738
250: "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
3839
4002: "0xf1277d1Ed8AD466beddF92ef448A132661956621",
40+
10: "0x4200000000000000000000000000000000000006", // optimism
41+
69: "0xbC6F6b680bc61e30dB47721c6D1c5cde19C1300d", // optimism testnet
42+
42161: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", // arbitrum
43+
421611: "0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9", // arbitrum testnet
3944
};
4045

4146
// Deploy FeeType
@@ -98,6 +103,14 @@ async function main() {
98103
console.log("Deploying Drop1155 at tx: ", drop1155.deployTransaction.hash);
99104
console.log("Drop1155 address: ", drop1155.address);
100105

106+
// Deploy a test implementation: DropERC20
107+
const drop20: DropERC20 = await ethers
108+
.getContractFactory("DropERC20")
109+
.then(f => f.deploy(thirdwebFee.address, options))
110+
.then(f => f.deployed());
111+
console.log("Deploying DropERC20 at tx: ", drop20.deployTransaction.hash);
112+
console.log("DropERC20 address: ", drop20.address);
113+
101114
// Deploy a test implementation: TokenERC20
102115
const tokenERC20: TokenERC20 = await ethers
103116
.getContractFactory("TokenERC20")
@@ -150,6 +163,7 @@ async function main() {
150163
[
151164
thirdwebFactory.interface.encodeFunctionData("addImplementation", [drop721.address]),
152165
thirdwebFactory.interface.encodeFunctionData("addImplementation", [drop1155.address]),
166+
thirdwebFactory.interface.encodeFunctionData("addImplementation", [drop20.address]),
153167
thirdwebFactory.interface.encodeFunctionData("addImplementation", [tokenERC20.address]),
154168
thirdwebFactory.interface.encodeFunctionData("addImplementation", [tokenERC721.address]),
155169
thirdwebFactory.interface.encodeFunctionData("addImplementation", [tokenERC1155.address]),
@@ -173,6 +187,7 @@ async function main() {
173187
await verify(thirdwebFee.address, [trustedForwarderAddress, thirdwebFactory.address]);
174188
await verify(drop721.address, [thirdwebFee.address]);
175189
await verify(drop1155.address, [thirdwebFee.address]);
190+
await verify(drop20.address, [thirdwebFee.address]);
176191
await verify(tokenERC20.address, [thirdwebFee.address]);
177192
await verify(tokenERC721.address, [thirdwebFee.address]);
178193
await verify(tokenERC1155.address, [thirdwebFee.address]);

0 commit comments

Comments
 (0)