Skip to content

Commit aa98e23

Browse files
committed
fix: local deployment of RiskFund
1 parent e16ffed commit aa98e23

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

deploy/006-risk-fund-v2.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
55
import { multisigs } from "../helpers/utils";
66

77
const func: DeployFunction = async ({
8-
network: { name },
8+
network: { name, live },
99
getNamedAccounts,
1010
deployments,
1111
}: HardhatRuntimeEnvironment) => {
@@ -27,13 +27,15 @@ const func: DeployFunction = async ({
2727
log: true,
2828
});
2929

30-
const targetOwner = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name];
30+
if (live) {
31+
const targetOwner = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name];
3132

32-
const contract = await ethers.getContract("RiskFundV2");
33-
if ((await contract.owner()) !== targetOwner && (await contract.pendingOwner()) !== targetOwner) {
34-
console.log(`Transferring ownership of RiskFundV2 to ${targetOwner}`);
35-
const tx = await contract.transferOwnership(targetOwner);
36-
await tx.wait();
33+
const contract = await ethers.getContract("RiskFundV2");
34+
if ((await contract.owner()) !== targetOwner && (await contract.pendingOwner()) !== targetOwner) {
35+
console.log(`Transferring ownership of RiskFundV2 to ${targetOwner}`);
36+
const tx = await contract.transferOwnership(targetOwner);
37+
await tx.wait();
38+
}
3739
}
3840
};
3941

0 commit comments

Comments
 (0)