-
Notifications
You must be signed in to change notification settings - Fork 6
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 #80 from VenusProtocol/develop
New release
- Loading branch information
Showing
52 changed files
with
18,935 additions
and
1,142 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
Binary file not shown.
Binary file not shown.
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
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,44 @@ | ||
import { ethers } from "hardhat"; | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
|
||
import { multisigs } from "../helpers/utils"; | ||
|
||
const func: DeployFunction = async ({ | ||
network: { name, live }, | ||
getNamedAccounts, | ||
deployments, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { deploy } = deployments; | ||
const { deployer } = await getNamedAccounts(); | ||
|
||
const proxyAdmin = await ethers.getContract("DefaultProxyAdmin"); | ||
const owner = await proxyAdmin.owner(); | ||
|
||
await deploy("RiskFundV2", { | ||
from: deployer, | ||
contract: "RiskFundV2", | ||
proxy: { | ||
owner: owner, | ||
proxyContract: "OpenZeppelinTransparentProxy", | ||
upgradeIndex: 0, | ||
}, | ||
autoMine: true, | ||
log: true, | ||
}); | ||
|
||
if (live) { | ||
const targetOwner = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name]; | ||
|
||
const contract = await ethers.getContract("RiskFundV2"); | ||
if ((await contract.owner()) !== targetOwner && (await contract.pendingOwner()) !== targetOwner) { | ||
console.log(`Transferring ownership of RiskFundV2 to ${targetOwner}`); | ||
const tx = await contract.transferOwnership(targetOwner); | ||
await tx.wait(); | ||
} | ||
} | ||
}; | ||
|
||
func.tags = ["RiskFundV2"]; | ||
|
||
export default func; |
Oops, something went wrong.