generated from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds proposeUpgradeWithApproval
- Loading branch information
1 parent
6fad6b6
commit f71d6ce
Showing
12 changed files
with
827 additions
and
1,442 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { task } from "hardhat/config"; | ||
import type { TaskArguments } from "hardhat/types"; | ||
|
||
task("proposeUpgradeWithApproval").setAction(async function (_taskArguments: TaskArguments, { ethers, defender, artifacts }) { | ||
const newVIDContract = await ethers.getContractFactoryFromArtifact(await artifacts.readArtifact("VioletIDv1_4_0")); | ||
try { | ||
const response = await defender.proposeUpgradeWithApproval( | ||
// Sepolia previous VID contract | ||
"0xE62C5A18Fb0e5f9b01bE9fAc679040e142e0e1FC", | ||
newVIDContract, | ||
); | ||
console.log(response); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
console.log("Task complete ✅"); | ||
}); | ||
|
||
export default {}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { task } from "hardhat/config"; | ||
import type { TaskArguments } from "hardhat/types"; | ||
|
||
task("validateUpgrade") | ||
.addParam("referenceAddress", "Address of the original VioletID") | ||
.setAction(async function (_taskArguments: TaskArguments, { ethers, upgrades }) { | ||
const newVIDContract = await ethers.getContractFactory("VioletIDv1_4_0"); | ||
try { | ||
const response = await upgrades.validateUpgrade(_taskArguments.referenceAddress, newVIDContract, { | ||
kind: "uups", | ||
}); | ||
console.log(response); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
console.log("Task complete ✅"); | ||
}); | ||
|
||
export default {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { validateUpgradeSafety } from "@openzeppelin/upgrades-core"; | ||
import { task } from "hardhat/config"; | ||
import type { TaskArguments } from "hardhat/types"; | ||
|
||
task("validateUpgradeSafety") | ||
.addParam("referenceName", "Address of the original VioletID") | ||
.setAction(async function (_taskArguments: TaskArguments) { | ||
try { | ||
const response = await validateUpgradeSafety( | ||
"artifacts/build-info", | ||
"VioletIDv1_4_0", | ||
_taskArguments.referenceName, | ||
); | ||
console.log(JSON.stringify(response)); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
console.log("Task complete ✅"); | ||
}); | ||
|
||
export default {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
import accounts from "./accounts"; | ||
import proposeUpgradeWithApproval from "./deploy/proposeUpgradeWithApproval"; | ||
import validate from "./deploy/validate"; | ||
import validateUpgradeSafety from "./deploy/validateUpgradeSafety"; | ||
import deployVioletID from "./deploy/violetID"; | ||
import grantRole from "./grantRole"; | ||
import renounceRole from "./renounceRole"; | ||
|
||
export { accounts, deployVioletID, grantRole, renounceRole }; | ||
export { | ||
accounts, | ||
deployVioletID, | ||
grantRole, | ||
renounceRole, | ||
validate, | ||
validateUpgradeSafety, | ||
proposeUpgradeWithApproval, | ||
}; |
Oops, something went wrong.