Skip to content

Commit 6b6625f

Browse files
Merge pull request #140 from BitGo/WIN-2711-deploy-v4-contracts-on-holesky
feat(deploy): v4 contracts on holesky chain
2 parents 70920c2 + 2046ad4 commit 6b6625f

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

hardhat.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const config: HardhatUserConfig = {
7070
},
7171
hteth: {
7272
url: `https://boldest-cosmological-mountain.ethereum-holesky.quiknode.pro/${QUICKNODE_ETH_HOLESKY_API_KEY}`,
73-
accounts: [`${TESTNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT}`]
73+
accounts: [`${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`]
7474
},
7575
matic: {
7676
url: `https://polygon-mainnet.g.alchemyapi.io/v2/${ALCHEMY_POLYGON_API_KEY}`,

scripts/deploy.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { use } from 'chai';
12
import { ethers } from 'hardhat';
23
const hre = require('hardhat');
34
const fs = require('fs');
@@ -19,6 +20,8 @@ async function main() {
1920

2021
let walletImplementationContractName = '';
2122
let walletFactoryContractName = 'WalletFactory';
23+
let forwarderContractName = 'Forwarder';
24+
let forwarderFactoryContractName = 'ForwarderFactory';
2225
const chainId = await deployer.getChainId();
2326
switch (await deployer.getChainId()) {
2427
// https://chainlist.org/
@@ -27,6 +30,8 @@ async function main() {
2730
//hteth
2831
case 17000:
2932
walletImplementationContractName = 'WalletSimple';
33+
forwarderContractName = 'ForwarderV4';
34+
forwarderFactoryContractName = 'ForwarderFactoryV4';
3035
break;
3136
//matic
3237
case 137:
@@ -87,22 +92,24 @@ async function main() {
8792
// In case of new coins like arbeth, opeth, zketh, we need to deploy new forwarder and forwarder factory i.e.
8893
// ForwarderV4 and ForwarderFactoryV4.
8994
// If we have to deploy contracts for the older coins like eth, avax, polygon, we need to deploy Forwarder and ForwarderFactory
90-
const Forwarder = await ethers.getContractFactory('ForwarderV4');
95+
const Forwarder = await ethers.getContractFactory(forwarderContractName);
9196
const forwarder = await Forwarder.deploy(gasParams);
9297
await forwarder.deployed();
9398
output.forwarderImplementation = forwarder.address;
94-
console.log('ForwarderV4 deployed at ' + forwarder.address);
99+
console.log(`${forwarderContractName} deployed at ` + forwarder.address);
95100

96101
const ForwarderFactory = await ethers.getContractFactory(
97-
'ForwarderFactoryV4'
102+
forwarderFactoryContractName
98103
);
99104
const forwarderFactory = await ForwarderFactory.deploy(
100105
forwarder.address,
101106
gasParams
102107
);
103108
await forwarderFactory.deployed();
104109
output.forwarderFactory = forwarderFactory.address;
105-
console.log('ForwarderFactoryV4 deployed at ' + forwarderFactory.address);
110+
console.log(
111+
`${forwarderFactoryContractName} deployed at ` + forwarderFactory.address
112+
);
106113

107114
fs.writeFileSync('output.json', JSON.stringify(output));
108115

@@ -121,13 +128,13 @@ async function main() {
121128
walletImplementationContractName,
122129
walletSimple.address,
123130
[],
124-
`contracts/coins/${walletImplementationContractName}.sol:${walletImplementationContractName}`
131+
`contracts/${walletImplementationContractName}.sol:${walletImplementationContractName}`
125132
);
126133
await verifyContract('WalletFactory', walletFactory.address, [
127134
walletSimple.address
128135
]);
129-
await verifyContract('ForwarderV4', forwarder.address, []);
130-
await verifyContract('ForwarderFactoryV4', forwarderFactory.address, [
136+
await verifyContract(forwarderContractName, forwarder.address, []);
137+
await verifyContract(forwarderFactoryContractName, forwarderFactory.address, [
131138
forwarder.address
132139
]);
133140
console.log('Contracts verified');

0 commit comments

Comments
 (0)