-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from Arrow-air/brasslion/feature/upgrade-process
Add upgrade script and process
- Loading branch information
Showing
5 changed files
with
401 additions
and
7 deletions.
There are no files selected for viewing
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,33 @@ | ||
|
||
const func = async (hre) => { | ||
const { deployments, upgrades, getNamedAccounts, ethers } = hre; | ||
|
||
const proxyAddress = process.env.ARROW_TOKEN_PROXY_CONTRACT; | ||
const multisigAddress = process.env.ARROW_TOKEN_MUTISIG; | ||
|
||
if (proxyAddress === undefined) { | ||
console.log("error: Undefined ARROW_TOKEN_PROXY_CONTRACT environment variable. Please define with the Arrow token proxy contract that should have it's implementation upgraded."); | ||
process.exit(1); | ||
} | ||
|
||
if (multisigAddress === undefined) { | ||
console.log("error: Undefined ARROW_TOKEN_MUTISIG environment variable. Please define with the Gnosis multisig address that holds ownership of the Arrow token contract."); | ||
process.exit(1); | ||
} | ||
|
||
const erc20Factory = await hre.ethers.getContractFactory("ArrowToken"); | ||
const oldToken = erc20Factory.attach(proxyAddress) | ||
|
||
console.log("Upgrading " + await oldToken.name() + "...") | ||
|
||
const proposal = await defender.proposeUpgrade(proxyAddress, erc20Factory, { | ||
multisig: multisigAddress, | ||
multisigType: "Gnosis Safe", | ||
title: "Upgrade ArrowToken", | ||
}); | ||
|
||
console.log("Upgrade proposal created at:", proposal.url); | ||
} | ||
|
||
func.tags = ["ArrowERC20", "Upgrade"]; | ||
module.exports = func; |
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
Oops, something went wrong.