File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
5
5
import { multisigs } from "../helpers/utils" ;
6
6
7
7
const func : DeployFunction = async ( {
8
- network : { name } ,
8
+ network : { name, live } ,
9
9
getNamedAccounts,
10
10
deployments,
11
11
} : HardhatRuntimeEnvironment ) => {
@@ -27,13 +27,15 @@ const func: DeployFunction = async ({
27
27
log : true ,
28
28
} ) ;
29
29
30
- const targetOwner = ( await ethers . getContractOrNull ( "NormalTimelock" ) ) ?. address || multisigs [ name ] ;
30
+ if ( live ) {
31
+ const targetOwner = ( await ethers . getContractOrNull ( "NormalTimelock" ) ) ?. address || multisigs [ name ] ;
31
32
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
+ }
37
39
}
38
40
} ;
39
41
You can’t perform that action at this time.
0 commit comments