diff --git a/contracts/deploy/085_deploy_l2_governance_proxies.js b/contracts/deploy/085_deploy_l2_governance_proxies.js index 9561bdccce..54c6da758b 100644 --- a/contracts/deploy/085_deploy_l2_governance_proxies.js +++ b/contracts/deploy/085_deploy_l2_governance_proxies.js @@ -9,7 +9,7 @@ const main = async (hre) => { const { deployerAddr } = await getNamedAccounts(); - await impersonateAndFund(deployerAddr) + await impersonateAndFund(deployerAddr); if (isArbitrumOneOrFork) { // Deploy L2 Governor on Arbitrum One @@ -31,6 +31,6 @@ const main = async (hre) => { main.id = deployName; main.skip = !(isArbitrumOneOrFork || isMainnetOrFork); -main.tags = ["arbitrum", "mainnet"]; +main.tags = ["arbitrumOne", "mainnet"]; module.exports = main; diff --git a/contracts/hardhat.config.js b/contracts/hardhat.config.js index 05a912b1a1..f66eee5934 100644 --- a/contracts/hardhat.config.js +++ b/contracts/hardhat.config.js @@ -47,9 +47,9 @@ task("accounts", "Prints the list of accounts", async (taskArguments, hre) => { }); const isFork = process.env.FORK === "true"; -const isArbitrum = process.env.FORK_NETWORK_NAME === "arbitrumOne"; +const isArbitrumFork = process.env.FORK_NETWORK_NAME === "arbitrumOne"; const isForkTest = isFork && process.env.IS_TEST === "true"; -const isArbForkTest = isForkTest && isArbitrum; +const isArbForkTest = isForkTest && isArbitrumFork; const providerUrl = `${ process.env.LOCAL_PROVIDER_URL || process.env.PROVIDER_URL }`; @@ -124,7 +124,8 @@ module.exports = { accounts: { mnemonic, }, - chainId: isFork ? (isArbitrum ? 42161 : 1) : 1337, + chainId: isFork ? (isArbitrumFork ? 42161 : 1) : 1337, + ...(isArbitrumFork ? { tags: ["arbitrumOne"] } : {}), ...(isForkTest ? { timeout: 0, @@ -144,6 +145,7 @@ module.exports = { }, localhost: { timeout: 0, + ...(isArbitrumFork ? { tags: ["arbitrumOne"] } : {}), }, mainnet: { url: `${process.env.PROVIDER_URL}`, @@ -159,6 +161,9 @@ module.exports = { process.env.GOVERNOR_PK || privateKeys[0], ], chainId: 42161, + tags: ["arbitrumOne"], + live: true, + saveDeployments: true, // Fails if gas limit is anything less than 20M on Arbitrum One gas: 20000000, // initialBaseFeePerGas: 0, diff --git a/contracts/node.sh b/contracts/node.sh index 5f4b1309e5..3116960333 100755 --- a/contracts/node.sh +++ b/contracts/node.sh @@ -29,7 +29,7 @@ main() if [[ $FORK_NETWORK_NAME == "arbitrumOne" ]]; then PROVIDER_URL=$ARBITRUM_PROVIDER_URL; BLOCK_NUMBER=$ARBITRUM_BLOCK_NUMBER; - params+=("--no-deploy "); + params+=" --tags arbitrumOne" fi echo "Fork Network: $FORK_NETWORK_NAME" @@ -50,7 +50,7 @@ main() nodeOutput=$(mktemp "${TMPDIR:-/tmp/}$(basename 0).XXX") # the --no-install is here so npx doesn't download some package on its own if it can not find one in the repo - FORK=true npx --no-install hardhat node --no-reset ${params[@]} > $nodeOutput 2>&1 & + FORK_NETWORK_NAME=$FORK_NETWORK_NAME FORK=true npx --no-install hardhat node --no-reset ${params[@]} > $nodeOutput 2>&1 & tail -f $nodeOutput & @@ -67,13 +67,9 @@ main() done printf "\n" - # if [[ $FORK_NETWORK_NAME == "arbitrumOne" ]]; then - # FORK=true npx hardhat deploy --network localhost --tags arbitrum - # fi - echo "🟢 Node initialized" - FORK=true npx hardhat fund --amount 100000 --network localhost --accountsfromenv true & + FORK_NETWORK_NAME=$FORK_NETWORK_NAME FORK=true npx hardhat fund --amount 100000 --network localhost --accountsfromenv true & # wait for subprocesses to finish for job in `jobs -p` diff --git a/contracts/package.json b/contracts/package.json index 39ad1cc446..5f728f7549 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -6,7 +6,7 @@ "scripts": { "deploy": "rm -rf deployments/hardhat && npx hardhat deploy", "deploy:mainnet": "npx hardhat deploy --network mainnet --verbose", - "deploy:arbitrum": "npx hardhat deploy --network arbitrumOne --tags arbitrum --verbose", + "deploy:arbitrum": "npx hardhat deploy --network arbitrumOne --tags arbitrumOne --verbose", "abi:generate": "(rm -rf deployments/hardhat && mkdir -p dist/abi && npx hardhat deploy --export '../dist/network.json')", "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", "node": "yarn run node:fork", diff --git a/contracts/test/_fixture-arb.js b/contracts/test/_fixture-arb.js index a3176b58e1..1b4b98040b 100644 --- a/contracts/test/_fixture-arb.js +++ b/contracts/test/_fixture-arb.js @@ -28,11 +28,13 @@ const defaultArbitrumFixture = deployments.createFixture(async () => { } log( - `Before deployments with param "${isFork ? ["arbitrum"] : ["unit_tests"]}"` + `Before deployments with param "${ + isFork ? ["arbitrumOne"] : ["unit_tests"] + }"` ); // Run the contract deployments - await deployments.fixture(isFork ? ["arbitrum"] : ["unit_tests"], { + await deployments.fixture(isFork ? ["arbitrumOne"] : ["unit_tests"], { keepExistingDeployments: true, fallbackToGlobal: true, }); diff --git a/contracts/utils/delpoy-l2.js b/contracts/utils/delpoy-l2.js index 1706c72b28..83589d9455 100644 --- a/contracts/utils/delpoy-l2.js +++ b/contracts/utils/delpoy-l2.js @@ -35,7 +35,7 @@ function deployOnArb(opts, fn) { main.id = deployName; main.dependencies = dependencies || []; - main.tags = ["arbitrum"]; + main.tags = ["arbitrumOne"]; main.skip = () => !( diff --git a/contracts/utils/deploy.js b/contracts/utils/deploy.js index 94e61d6e98..9d7d9c51e3 100644 --- a/contracts/utils/deploy.js +++ b/contracts/utils/deploy.js @@ -17,6 +17,7 @@ const { isForkTest, getBlockTimestamp, isArbitrumOneOrFork, + isArbitrumOne, } = require("../test/helpers.js"); const { @@ -90,7 +91,7 @@ const deployWithConfirmation = async ( ); // if upgrade happened on the mainnet save the new storage slot layout to the repo - if (isMainnet) { + if (isMainnet || isArbitrumOne) { await storeStorageLayoutForContract(hre, contractName); } @@ -707,7 +708,9 @@ const submitProposalToOgvGovernance = async ( /** * Sanity checks to perform before running the deploy */ -const sanityCheckOgvGovernance = async ({ deployerIsProposer = false }) => { +const sanityCheckOgvGovernance = async ({ + deployerIsProposer = false, +} = {}) => { if (isMainnet) { // only applicable when OGV governance is the governor if (deployerIsProposer) {