diff --git a/scripts/upgrade_vault.js b/scripts/upgrade_vault.js index 10390bc..320d5e8 100644 --- a/scripts/upgrade_vault.js +++ b/scripts/upgrade_vault.js @@ -1,7 +1,9 @@ const { ethers, upgrades } = require("hardhat"); +const fs = require('fs'); +const { TESTNET_VAULT } = require('../keystore.json'); // Current Address of the Vault -const currentVaultAddress = process.env.TESTNET_VAULT; +const currentVaultAddress = TESTNET_VAULT; async function main() { const upgradedVault = await ethers.getContractFactory("Vault"); @@ -9,6 +11,16 @@ async function main() { const vault = await upgrades.upgradeProxy(currentVaultAddress, upgradedVault); console.log("Vault upgraded", vault.address); + + const filePath = 'keystore.json'; + + fs.unlink(filePath, (err) => { + if (err) { + console.error(`Error deleting file: ${err}`); + return; + } + console.log('File deleted successfully'); +}); } main(); \ No newline at end of file diff --git a/scripts/upgrade_vault_mainnet.js b/scripts/upgrade_vault_mainnet.js index bb73517..9939522 100644 --- a/scripts/upgrade_vault_mainnet.js +++ b/scripts/upgrade_vault_mainnet.js @@ -1,7 +1,9 @@ const { ethers, upgrades } = require("hardhat"); +const fs = require('fs'); +const { MAINNET_VAULT } = require('../keystore.json'); // Address of the Vault -const currentVaultAddress = process.env.MAINNET_VAULT; +const currentVaultAddress = MAINNET_VAULT; async function main() { const upgradedVault = await ethers.getContractFactory("Vault"); @@ -9,6 +11,16 @@ async function main() { const vault = await upgrades.upgradeProxy(currentVaultAddress, upgradedVault); console.log("Vault upgraded", vault.address); + + const filePath = 'keystore.json'; + + fs.unlink(filePath, (err) => { + if (err) { + console.error(`Error deleting file: ${err}`); + return; + } + console.log('File deleted successfully'); +}); } main(); \ No newline at end of file