Add an example script on how to upgrade a contract implementation
This commit is contained in:
16
scripts/upgrade-example.js
Normal file
16
scripts/upgrade-example.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const { ethers, upgrades } = require("hardhat");
|
||||
const Kredits = require('../lib/kredits');
|
||||
|
||||
async function main() {
|
||||
const network = await hre.ethers.provider.getNetwork();
|
||||
kredits = new Kredits(hre.ethers.provider, hre.ethers.provider.getSigner());
|
||||
await kredits.init();
|
||||
|
||||
const ContributorV2 = await ethers.getContractFactory("Contributor");
|
||||
const contributor = await upgrades.upgradeProxy(kredits.Contributor.address, ContributorV2);
|
||||
console.log("Contributor upgraded");
|
||||
|
||||
console.log("DONE!");
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user