From ba8c192b58ce66796bd17cd114c8a5791fb8d6a3 Mon Sep 17 00:00:00 2001 From: ihoroleksiienko Date: Fri, 8 Nov 2024 15:47:35 +0200 Subject: [PATCH] chore: update scripts --- scripts/deployProxy.ts | 4 ++-- scripts/prepareUpgrade.ts | 13 ++++++------- scripts/upgradeProxy.ts | 13 ++++++------- scripts/validateUpgrade.ts | 13 ++++++------- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/scripts/deployProxy.ts b/scripts/deployProxy.ts index b4b685d..79d67b8 100644 --- a/scripts/deployProxy.ts +++ b/scripts/deployProxy.ts @@ -1,8 +1,8 @@ import { ethers, upgrades } from "hardhat"; async function main() { - const CONTRACT_NAME: string = ""; // TODO: Enter contract name - const TOKEN_ADDRESS: string = ""; // TODO: Enter token contract address + const CONTRACT_NAME: string = ""; // TBD: Enter contract name + const TOKEN_ADDRESS: string = ""; // TBD: Enter token contract address const factory = await ethers.getContractFactory(CONTRACT_NAME); const proxy = await upgrades.deployProxy( diff --git a/scripts/prepareUpgrade.ts b/scripts/prepareUpgrade.ts index a382a66..edf2afc 100644 --- a/scripts/prepareUpgrade.ts +++ b/scripts/prepareUpgrade.ts @@ -1,15 +1,14 @@ import { ethers, upgrades } from "hardhat"; async function main() { - const CONTRACT_NAME: string = ""; // TODO: Enter contract name - const PROXY_ADDRESS: string = ""; // TODO: Enter proxy address - - // Upgrade options: - // - unsafeAllowRenames: true - // - unsafeSkipStorageCheck: true + const CONTRACT_NAME: string = ""; // TBD: Enter contract name + const PROXY_ADDRESS: string = ""; // TBD: Enter proxy address const factory = await ethers.getContractFactory(CONTRACT_NAME); - const response = await upgrades.prepareUpgrade(PROXY_ADDRESS, factory); + const response = await upgrades.prepareUpgrade(PROXY_ADDRESS, factory, { + unsafeAllowRenames: false, + unsafeSkipStorageCheck: false + }); console.log("Upgrade prepared:", response); } diff --git a/scripts/upgradeProxy.ts b/scripts/upgradeProxy.ts index 5306f22..90cea1d 100644 --- a/scripts/upgradeProxy.ts +++ b/scripts/upgradeProxy.ts @@ -1,15 +1,14 @@ import { ethers, upgrades } from "hardhat"; async function main() { - const CONTRACT_NAME: string = ""; // TODO: Enter contract name - const PROXY_ADDRESS: string = ""; // TODO: Enter proxy address - - // Upgrade options: - // - unsafeAllowRenames: true - // - unsafeSkipStorageCheck: true + const CONTRACT_NAME: string = ""; // TBD: Enter contract name + const PROXY_ADDRESS: string = ""; // TBD: Enter proxy address const factory = await ethers.getContractFactory(CONTRACT_NAME); - await upgrades.upgradeProxy(PROXY_ADDRESS, factory); + await upgrades.upgradeProxy(PROXY_ADDRESS, factory, { + unsafeAllowRenames: false, + unsafeSkipStorageCheck: false + }); console.log("Proxy upgraded"); } diff --git a/scripts/validateUpgrade.ts b/scripts/validateUpgrade.ts index 81eddfb..40b72cf 100644 --- a/scripts/validateUpgrade.ts +++ b/scripts/validateUpgrade.ts @@ -1,15 +1,14 @@ import { ethers, upgrades } from "hardhat"; async function main() { - const CONTRACT_NAME: string = ""; // TODO: Enter contract name - const PROXY_ADDRESS: string = ""; // TODO: Enter proxy address - - // Upgrade options: - // - unsafeAllowRenames: true - // - unsafeSkipStorageCheck: true + const CONTRACT_NAME: string = ""; // TBD: Enter contract name + const PROXY_ADDRESS: string = ""; // TBD: Enter proxy address const factory = await ethers.getContractFactory(CONTRACT_NAME); - await upgrades.validateUpgrade(PROXY_ADDRESS, factory); + await upgrades.validateUpgrade(PROXY_ADDRESS, factory, { + unsafeAllowRenames: false, + unsafeSkipStorageCheck: false + }); console.log("Successfully validated"); }