Skip to content

Commit 46ba299

Browse files
authored
Fix L2 deploy tooling network name on fork (#2385)
* Fix L2 deploy tooling network name on fork * Remove unused variables * Also account for non-standalone node mode
1 parent f49e09c commit 46ba299

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

contracts/utils/deploy-l2.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ const {
66
advanceTime,
77
advanceBlocks,
88
} = require("../test/helpers");
9-
const addresses = require("./addresses");
109
const {
1110
deployWithConfirmation,
1211
withConfirmation,
1312
impersonateGuardian,
14-
handleTransitionGovernance,
1513
buildGnosisSafeJson,
1614
constructContractMethod,
1715
} = require("./deploy");
@@ -36,13 +34,23 @@ function log(msg, deployResult = null) {
3634
}
3735
}
3836

37+
function getNetworkName() {
38+
if (isForkTest) {
39+
return "hardhat";
40+
} else if (isFork) {
41+
return "localhost";
42+
} else {
43+
return process.env.NETWORK_NAME || "mainnet";
44+
}
45+
}
46+
3947
async function buildAndSimulateTimelockOperations(
4048
deployName,
4149
propDesc,
4250
propArgs
4351
) {
4452
console.log("Building and simulating timelock operations for", deployName);
45-
const networkName = process.env.FORK_NETWORK_NAME;
53+
const networkName = getNetworkName();
4654
const { guardianAddr, timelockAddr } = await getNamedAccounts();
4755

4856
const timelock = await ethers.getContractAt(
@@ -125,7 +133,7 @@ async function simulateTimelockOperations(deployName) {
125133
return false;
126134
}
127135

128-
const networkName = process.env.FORK_NETWORK_NAME;
136+
const networkName = getNetworkName();
129137

130138
const scheduleFilePath = path.resolve(
131139
__dirname,

0 commit comments

Comments
 (0)