Add reinitializer for upgrades to Contributor
In order to be able to re-initialize the upgraded contract with the profile manager address, we need a new re-initializer function that is automatically allowed to only be executed once per contract implementation version. Co-authored-by: Michael Bumann <hello@michaelbumann.com>
This commit is contained in:
@@ -7,7 +7,17 @@ async function main() {
|
||||
await kredits.init();
|
||||
|
||||
const ContributorV2 = await ethers.getContractFactory("Contributor");
|
||||
const contributor = await upgrades.upgradeProxy(kredits.Contributor.address, ContributorV2);
|
||||
const contributor = await upgrades.upgradeProxy(
|
||||
kredits.Contributor.address,
|
||||
ContributorV2,
|
||||
{
|
||||
call: {
|
||||
fn: "reinitialize",
|
||||
args: [
|
||||
"0xc80d2513277FA04B10403E2D1d7dAa86F931f4d1"
|
||||
]
|
||||
}
|
||||
});
|
||||
console.log("Contributor upgraded");
|
||||
console.log(`Contributor address: ${contributor.address}`);
|
||||
|
||||
@@ -16,4 +26,4 @@ async function main() {
|
||||
console.log("DONE!");
|
||||
}
|
||||
|
||||
main();
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user