Skip to content

Commit 03a6485

Browse files
committed
deploy: mainnet: upgrade UniswapV3Pool
1 parent 6516940 commit 03a6485

File tree

3 files changed

+192
-14
lines changed

3 files changed

+192
-14
lines changed

deploy/individual/UniswapV3Pool.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { HardhatRuntimeEnvironment, Network } from "hardhat/types";
2+
import { DeployFunction } from "hardhat-deploy/types";
3+
import { getConfig, getContract } from "../utils";
4+
5+
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
6+
const { deploy, execute, deployer, deployments } = await getConfig(hre);
7+
8+
const poolImpl = await deploy("UniswapV3PoolUpgradeable", {
9+
from: deployer,
10+
log: true,
11+
});
12+
13+
// ==
14+
const uniswapFactory = await deployments.get("UniswapV3FactoryUpgradeable");
15+
const uniswapFactoryContract = await getContract(
16+
hre,
17+
"UniswapV3FactoryUpgradeable",
18+
uniswapFactory.address
19+
);
20+
const owner = await uniswapFactoryContract.owner();
21+
if (owner === deployer) {
22+
console.log("Setting new Pool Impl in UniswapV3Factory...");
23+
await execute(
24+
"UniswapV3FactoryUpgradeable",
25+
{ from: deployer },
26+
"upgradeBeaconTo",
27+
poolImpl.address
28+
);
29+
console.log("New Pool Impl set in UniswapV3Factory");
30+
} else {
31+
console.warn(
32+
"[⚠️ NOTE!] call upgradeBeaconTo on UniswapV3FactoryUpgradeable to set the new Pool Impl"
33+
);
34+
}
35+
};
36+
export default func;
37+
func.tags = ["UniswapV3Pool"];

deployments/mainnet/UniswapV3PoolUpgradeable.json

Lines changed: 14 additions & 14 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)