forked from superpowerlabs/bc-genesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrade.js
35 lines (30 loc) · 1.19 KB
/
upgrade.js
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
31
32
33
34
35
// We require the Hardhat Runtime Environment explicitly here. This is optional
// but useful for running the script in a standalone fashion through `node <script>`.
//
// When running the script with `hardhat run <script>` you'll find the Hardhat
// Runtime Environment's members available in the global scope.
require("dotenv").config();
const hre = require("hardhat");
const ethers = hre.ethers;
const deployed = require("../export/deployed.json");
const DeployUtils = require("../lib/DeployUtils");
let deployUtils;
async function main() {
deployUtils = new DeployUtils(ethers);
require("./consoleLogAlert")();
const chainId = await deployUtils.currentChainId();
const contractName = process.env.CONTRACT;
const gasLimit = parseInt(process.env.GAS_LIMIT || "0");
// const address = deployed[chainId][contract];
// const Contract = await ethers.getContractFactory(contract);
// console.log("Upgrading", contract);
// await upgrades.upgradeProxy(address, Contract, gasLimit ? {gasLimit} : {});
// console.log("Done");
await deployUtils.upgradeProxy(contractName, gasLimit);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});