Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/block-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ async function checkAddressContractStatus({
return;
}
}
if (body.status == "0" && body.result.includes("Invalid API Key")) {
throw new Error(`Invalid API key`);
}

logCallback(`${address} appears to be an EOA. Retrying in ${checkInterval / 1000} seconds...`, LogType.Level1);
await new Promise((resolve) => setTimeout(resolve, checkInterval));
Expand All @@ -70,8 +73,9 @@ async function checkAddressContractStatus({
await new Promise((resolve) => setTimeout(resolve, checkInterval));
}
}

logCallback(`${address} could not be confirmed as a contract after ${maxTries} attempts.`, LogType.Level1);
const errorMessage = `${address} could not be confirmed as a contract after ${maxTries} attempts.`;
logCallback(errorMessage, LogType.Level1);
throw new Error(errorMessage);
}

export {
Expand Down
1 change: 0 additions & 1 deletion src/integration-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupIntegrationTests(
TESTING_OPT_L2_REBASABLE_TOKEN: deployedContracts.l2.tokenRebasableProxyAddress,
TESTING_OPT_L2_ERC20_TOKEN_BRIDGE: deployedContracts.l2.tokenBridgeProxyAddress,
}, { override: true });
console.log("process.env=", process.env);
}

async function runIntegrationTestsScript({
Expand Down
13 changes: 7 additions & 6 deletions src/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { LogCallback, LogType } from "./log-utils";
import { DeployParameters, MainConfig, TestingParameters } from "./main-config";
import { diffyscanRpcUrl, l1RpcUrl, l2RpcUrl, localL1RpcPort, localL2RpcPort, NetworkType } from "./rpc-utils";
import { runStateMateScript, setupStateMateConfig, setupStateMateEnvs } from "./state-mate";
import { runVerificationScript, setupGovExecutorVerification } from "./verification";
import { runVerificationScript, setupGovExecutorVerification, setupHardhatConfigInL2Repo } from "./verification";

const NUM_L1_DEPLOYED_CONTRACTS = 10;

Expand Down Expand Up @@ -197,6 +197,11 @@ const deployAndTestOnForksSteps: Step[] = [
];

const deployOnRealNetworkSteps: Step[] = [
{
name: "Burn L2 Deployer Nonces",
action: (_, logCallback) =>
burnL2DeployerNonces(l2RpcUrl(NetworkType.Live), NUM_L1_DEPLOYED_CONTRACTS, logCallback),
},
{
name: "Deploy Governance Executor",
action: async (ctx, logCallback) => {
Expand All @@ -216,11 +221,6 @@ const deployOnRealNetworkSteps: Step[] = [
});
},
},
{
name: "Burn L2 Deployer Nonces",
action: (_, logCallback) =>
burnL2DeployerNonces(l2RpcUrl(NetworkType.Live), NUM_L1_DEPLOYED_CONTRACTS, logCallback),
},
{
name: "Run Deploy Script",
action: async (ctx, logCallback) => {
Expand Down Expand Up @@ -282,6 +282,7 @@ const publishSourcesSteps: Step[] = [
{
name: "Verification",
action: async (_, logCallback) => {
setupHardhatConfigInL2Repo();
await runVerificationScript({
config: "l1_live_deployment_args.json",
network: "l1",
Expand Down
23 changes: 21 additions & 2 deletions src/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,27 @@ function setupGovExecutorVerification() {
);
}

function setupHardhatConfigInL2Repo() {
dotenv.populate(
process.env as { [key: string]: string },
{
L1_PRC_URL: env.url("L1_REMOTE_RPC_URL"),
L2_PRC_URL: env.url("L2_REMOTE_RPC_URL"),
L1_BLOCK_EXPLORER_API_KEY: env.string("L1_EXPLORER_TOKEN"),
L2_BLOCK_EXPLORER_API_KEY: env.string("L2_EXPLORER_TOKEN"),
L1_CHAIN_ID: env.string("L1_CHAIN_ID"),
L2_CHAIN_ID: env.string("L2_CHAIN_ID"),
L1_BLOCK_EXPLORER_BROWSER_URL: env.url("L1_BLOCK_EXPLORER_BROWSER_URL"),
L2_BLOCK_EXPLORER_BROWSER_URL: env.url("L2_BLOCK_EXPLORER_BROWSER_URL"),
L1_BLOCK_EXPLORER_API_URL: `https://${env.string("L1_BLOCK_EXPLORER_API_HOST")}/api`,
L2_BLOCK_EXPLORER_API_URL: `https://${env.string("L2_BLOCK_EXPLORER_API_HOST")}/api`
}
);
}

export {
runVerificationScript,
waitForBlockFinalization,
setupGovExecutorVerification
}
setupGovExecutorVerification,
setupHardhatConfigInL2Repo
}