Skip to content

Commit

Permalink
deploy l1 nova address registry
Browse files Browse the repository at this point in the history
  • Loading branch information
DZGoldman committed Nov 2, 2023
1 parent 3c2cdcb commit 2778ed3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/mainnet/deployedContracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
"l1ProxyAdmin": "0x5613AF0474EB9c528A34701A5b1662E3C8FA0678",
"l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49",
"l1AddressRegistry": "0xd514C2b3aaBDBfa10800B9C96dc1eB25427520A0",
"l2AddressRegistry":"0x56C4E9Eb6c63aCDD19AeC2b1a00e4f0d7aBda9d3"
"l2AddressRegistry":"0x56C4E9Eb6c63aCDD19AeC2b1a00e4f0d7aBda9d3",
"novaL1AddressRegistry":"0x2F06643fc2CC18585Ae790b546388F0DE4Ec6635"
}
52 changes: 52 additions & 0 deletions scripts/deployNovaAddressRegistry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Wallet } from "@ethersproject/wallet";
import { JsonRpcProvider } from "@ethersproject/providers";
import { L1AddressRegistry__factory } from "../typechain-types";

import { ContractVerifier } from "./contractVerifier";
import dotenv from "dotenv";
import { utils } from "ethers";
const abi = utils.defaultAbiCoder;

dotenv.config();

const ETH_URL = process.env.ETH_URL;
const ETH_KEY = process.env.ETH_KEY;
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY;

if (!ETH_URL) throw new Error("ETH_URL required");
if (!ETH_KEY) throw new Error("ETH_KEY required");
if (!ETHERSCAN_API_KEY) throw new Error("ETHERSCAN_API_KEY required");

const main = async () => {
const l1Provider = new JsonRpcProvider(ETH_URL);
const signer = new Wallet(ETH_KEY, l1Provider);

const l1Verifier = new ContractVerifier(1, ETHERSCAN_API_KEY, {});

const NOVA_INBOX = "0xc4448b71118c9071Bcb9734A0EAc55D18A153949";
const L1_GOV_TIMELOCK = "0xE6841D92B0C345144506576eC13ECf5103aC7f49";
const NOVA_L1_CUSTOM_GATEWAY = "0x23122da8C581AA7E0d07A36Ff1f16F799650232f";
const NOVA_L1_GATEWAY_ROUTER = "0xC840838Bc438d73C16c2f8b22D2Ce3669963cD48";

const novaL1AddressRegistry = await new L1AddressRegistry__factory(signer).deploy(
NOVA_INBOX, // nova inbox
L1_GOV_TIMELOCK, // l1 gov timelock
NOVA_L1_CUSTOM_GATEWAY, // nova l1 custom gateway
NOVA_L1_GATEWAY_ROUTER // nova l1 gateway router
);
await novaL1AddressRegistry.deployed();
console.log("L1AddressRegistry deployed at", novaL1AddressRegistry.address);

await l1Verifier.verifyWithAddress(
"L1AddressRegistry",
novaL1AddressRegistry.address,
abi.encode(
["address", "address", "address", "address"],
[NOVA_INBOX, L1_GOV_TIMELOCK, NOVA_L1_CUSTOM_GATEWAY, NOVA_L1_GATEWAY_ROUTER]
)
);
};

main().then(() => {
console.log("Done");
});

0 comments on commit 2778ed3

Please sign in to comment.