Skip to content

Commit c983c9a

Browse files
committed
WIP
1 parent e63aa85 commit c983c9a

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

deploy/005_deploy_arbitrum_spokepool.ts

-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ const func = async function () {
3131
const implementationAddress = await upgrades.erc1967.getImplementationAddress(instance.address);
3232
console.log(`Implementation deployed @ ${implementationAddress}`);
3333

34-
// Deploy new implementation and validate that it can be used in upgrade.
35-
const newImplementation = await upgrades.prepareUpgrade(
36-
instance.address,
37-
await getContractFactory("Arbitrum_SpokePool")
38-
);
39-
console.log(`Can upgrade to new implementation @ ${newImplementation}`);
40-
4134
// hardhat-upgrades overrides the `verify` task that ships with `hardhat` so that if the address passed
4235
// is a proxy, hardhat will first verify the implementation and then the proxy and also link the proxy
4336
// to the implementation's ABI on etherscan.

deploy/022_upgrade_spokepool.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import "hardhat-deploy";
2+
import hre from "hardhat";
3+
import { getContractFactory } from "../utils";
4+
import * as deployments from "../deployments/deployments.json";
5+
6+
const func = async function () {
7+
const { upgrades, run, getChainId } = hre;
8+
9+
const chainId = await getChainId();
10+
const spokePool = await deployments[chainId].SpokePool;
11+
console.log(`Using spoke pool @ ${spokePool.address}`);
12+
13+
// Deploy new implementation and validate that it can be used in upgrade, without actually upgrading it.
14+
const newImplementation = await upgrades.prepareUpgrade(
15+
spokePool.address,
16+
await getContractFactory("Arbitrum_SpokePool")
17+
);
18+
console.log(`Can upgrade to new implementation @ ${newImplementation}`);
19+
20+
// hardhat-upgrades overrides the `verify` task that ships with `hardhat` so that if the address passed
21+
// is a proxy, hardhat will first verify the implementation and then the proxy and also link the proxy
22+
// to the implementation's ABI on etherscan.
23+
// https://docs.openzeppelin.com/upgrades-plugins/1.x/api-hardhat-upgrades#verify
24+
await run("verify:verify", {
25+
address: newImplementation,
26+
});
27+
};
28+
module.exports = func;
29+
func.tags = ["UpgradeSpokePool"];

0 commit comments

Comments
 (0)