forked from scroll-tech/scroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy_proxy_admin.ts
30 lines (25 loc) · 1.01 KB
/
deploy_proxy_admin.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* eslint-disable node/no-missing-import */
import * as hre from "hardhat";
import { ethers } from "hardhat";
import { selectAddressFile } from "./utils";
async function main() {
const addressFile = selectAddressFile(hre.network.name);
const [deployer] = await ethers.getSigners();
if (!addressFile.get("ProxyAdmin")) {
console.log(">> Deploy ProxyAdmin");
const ProxyAdmin = await ethers.getContractFactory("ProxyAdmin", deployer);
const proxyAdmin = await ProxyAdmin.deploy();
console.log(`>> waiting for transaction: ${proxyAdmin.deployTransaction.hash}`);
await proxyAdmin.deployed();
console.log(`✅ ProxyAdmin deployed at ${proxyAdmin.address}`);
addressFile.set("ProxyAdmin", proxyAdmin.address);
}
// Export contract address to testnet.
console.log(`testnet-export: ${addressFile.get("ProxyAdmin")}`);
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});