Skip to content

Commit

Permalink
Merge pull request #54 from CanzaApps/mainnet-deployment
Browse files Browse the repository at this point in the history
refactored upgrade scripts
  • Loading branch information
David405 authored May 6, 2024
2 parents 115554d + 913a24e commit 957b0b9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion scripts/upgrade_vault.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
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");

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();
14 changes: 13 additions & 1 deletion scripts/upgrade_vault_mainnet.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
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");

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();

0 comments on commit 957b0b9

Please sign in to comment.