Skip to content

Commit 1805822

Browse files
committed
Fix deploy script
1 parent 1fb49bb commit 1805822

File tree

7 files changed

+24
-18
lines changed

7 files changed

+24
-18
lines changed

contracts/deploy/085_deploy_l2_governance_proxies.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const main = async (hre) => {
99

1010
const { deployerAddr } = await getNamedAccounts();
1111

12-
await impersonateAndFund(deployerAddr)
12+
await impersonateAndFund(deployerAddr);
1313

1414
if (isArbitrumOneOrFork) {
1515
// Deploy L2 Governor on Arbitrum One
@@ -31,6 +31,6 @@ const main = async (hre) => {
3131

3232
main.id = deployName;
3333
main.skip = !(isArbitrumOneOrFork || isMainnetOrFork);
34-
main.tags = ["arbitrum", "mainnet"];
34+
main.tags = ["arbitrumOne", "mainnet"];
3535

3636
module.exports = main;

contracts/hardhat.config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ task("accounts", "Prints the list of accounts", async (taskArguments, hre) => {
4747
});
4848

4949
const isFork = process.env.FORK === "true";
50-
const isArbitrum = process.env.FORK_NETWORK_NAME === "arbitrumOne";
50+
const isArbitrumFork = process.env.FORK_NETWORK_NAME === "arbitrumOne";
5151
const isForkTest = isFork && process.env.IS_TEST === "true";
52-
const isArbForkTest = isForkTest && isArbitrum;
52+
const isArbForkTest = isForkTest && isArbitrumFork;
5353
const providerUrl = `${
5454
process.env.LOCAL_PROVIDER_URL || process.env.PROVIDER_URL
5555
}`;
@@ -124,7 +124,8 @@ module.exports = {
124124
accounts: {
125125
mnemonic,
126126
},
127-
chainId: isFork ? (isArbitrum ? 42161 : 1) : 1337,
127+
chainId: isFork ? (isArbitrumFork ? 42161 : 1) : 1337,
128+
...(isArbitrumFork ? { tags: ["arbitrumOne"] } : {}),
128129
...(isForkTest
129130
? {
130131
timeout: 0,
@@ -144,6 +145,7 @@ module.exports = {
144145
},
145146
localhost: {
146147
timeout: 0,
148+
...(isArbitrumFork ? { tags: ["arbitrumOne"] } : {}),
147149
},
148150
mainnet: {
149151
url: `${process.env.PROVIDER_URL}`,
@@ -159,6 +161,9 @@ module.exports = {
159161
process.env.GOVERNOR_PK || privateKeys[0],
160162
],
161163
chainId: 42161,
164+
tags: ["arbitrumOne"],
165+
live: true,
166+
saveDeployments: true,
162167
// Fails if gas limit is anything less than 20M on Arbitrum One
163168
gas: 20000000,
164169
// initialBaseFeePerGas: 0,

contracts/node.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ main()
2929
if [[ $FORK_NETWORK_NAME == "arbitrumOne" ]]; then
3030
PROVIDER_URL=$ARBITRUM_PROVIDER_URL;
3131
BLOCK_NUMBER=$ARBITRUM_BLOCK_NUMBER;
32-
params+=("--no-deploy ");
32+
params+=" --tags arbitrumOne"
3333
fi
3434
echo "Fork Network: $FORK_NETWORK_NAME"
3535

@@ -50,7 +50,7 @@ main()
5050

5151
nodeOutput=$(mktemp "${TMPDIR:-/tmp/}$(basename 0).XXX")
5252
# the --no-install is here so npx doesn't download some package on its own if it can not find one in the repo
53-
FORK=true npx --no-install hardhat node --no-reset ${params[@]} > $nodeOutput 2>&1 &
53+
FORK_NETWORK_NAME=$FORK_NETWORK_NAME FORK=true npx --no-install hardhat node --no-reset ${params[@]} > $nodeOutput 2>&1 &
5454

5555
tail -f $nodeOutput &
5656

@@ -67,13 +67,9 @@ main()
6767
done
6868
printf "\n"
6969

70-
# if [[ $FORK_NETWORK_NAME == "arbitrumOne" ]]; then
71-
# FORK=true npx hardhat deploy --network localhost --tags arbitrum
72-
# fi
73-
7470
echo "🟢 Node initialized"
7571

76-
FORK=true npx hardhat fund --amount 100000 --network localhost --accountsfromenv true &
72+
FORK_NETWORK_NAME=$FORK_NETWORK_NAME FORK=true npx hardhat fund --amount 100000 --network localhost --accountsfromenv true &
7773

7874
# wait for subprocesses to finish
7975
for job in `jobs -p`

contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"deploy": "rm -rf deployments/hardhat && npx hardhat deploy",
88
"deploy:mainnet": "npx hardhat deploy --network mainnet --verbose",
9-
"deploy:arbitrum": "npx hardhat deploy --network arbitrumOne --tags arbitrum --verbose",
9+
"deploy:arbitrum": "npx hardhat deploy --network arbitrumOne --tags arbitrumOne --verbose",
1010
"abi:generate": "(rm -rf deployments/hardhat && mkdir -p dist/abi && npx hardhat deploy --export '../dist/network.json')",
1111
"abi:dist": "find ./artifacts/contracts -name \"*.json\" -type f -exec cp {} ./dist/abi \\; && rm -rf dist/abi/*.dbg.json dist/abi/Mock*.json && cp ./abi.package.json dist/package.json && cp ./.npmrc.abi dist/.npmrc",
1212
"node": "yarn run node:fork",

contracts/test/_fixture-arb.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ const defaultArbitrumFixture = deployments.createFixture(async () => {
2828
}
2929

3030
log(
31-
`Before deployments with param "${isFork ? ["arbitrum"] : ["unit_tests"]}"`
31+
`Before deployments with param "${
32+
isFork ? ["arbitrumOne"] : ["unit_tests"]
33+
}"`
3234
);
3335

3436
// Run the contract deployments
35-
await deployments.fixture(isFork ? ["arbitrum"] : ["unit_tests"], {
37+
await deployments.fixture(isFork ? ["arbitrumOne"] : ["unit_tests"], {
3638
keepExistingDeployments: true,
3739
fallbackToGlobal: true,
3840
});

contracts/utils/delpoy-l2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function deployOnArb(opts, fn) {
3535
main.id = deployName;
3636
main.dependencies = dependencies || [];
3737

38-
main.tags = ["arbitrum"];
38+
main.tags = ["arbitrumOne"];
3939

4040
main.skip = () =>
4141
!(

contracts/utils/deploy.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const {
1717
isForkTest,
1818
getBlockTimestamp,
1919
isArbitrumOneOrFork,
20+
isArbitrumOne,
2021
} = require("../test/helpers.js");
2122

2223
const {
@@ -90,7 +91,7 @@ const deployWithConfirmation = async (
9091
);
9192

9293
// if upgrade happened on the mainnet save the new storage slot layout to the repo
93-
if (isMainnet) {
94+
if (isMainnet || isArbitrumOne) {
9495
await storeStorageLayoutForContract(hre, contractName);
9596
}
9697

@@ -707,7 +708,9 @@ const submitProposalToOgvGovernance = async (
707708
/**
708709
* Sanity checks to perform before running the deploy
709710
*/
710-
const sanityCheckOgvGovernance = async ({ deployerIsProposer = false }) => {
711+
const sanityCheckOgvGovernance = async ({
712+
deployerIsProposer = false,
713+
} = {}) => {
711714
if (isMainnet) {
712715
// only applicable when OGV governance is the governor
713716
if (deployerIsProposer) {

0 commit comments

Comments
 (0)