-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path40_deploy_redemption_watchtower.ts
43 lines (36 loc) · 1.29 KB
/
40_deploy_redemption_watchtower.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { HardhatRuntimeEnvironment } from "hardhat/types"
import { DeployFunction } from "hardhat-deploy/types"
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, ethers, helpers, getNamedAccounts } = hre
const { deployer } = await getNamedAccounts()
const Bridge = await deployments.get("Bridge")
const [redemptionWatchtower, proxyDeployment] =
await helpers.upgrades.deployProxy("RedemptionWatchtower", {
contractName: "RedemptionWatchtower",
initializerArgs: [Bridge.address],
factoryOpts: {
signer: await ethers.getSigner(deployer),
},
proxyOpts: {
kind: "transparent",
},
})
if (hre.network.tags.etherscan) {
// We use `verify` instead of `verify:verify` as the `verify` task is defined
// in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification
// of Proxy and Implementation contracts.
await hre.run("verify", {
address: proxyDeployment.address,
constructorArgsParams: proxyDeployment.args,
})
}
if (hre.network.tags.tenderly) {
await hre.tenderly.verify({
name: "RedemptionWatchtower",
address: redemptionWatchtower.address,
})
}
}
export default func
func.tags = ["RedemptionWatchtower"]
func.dependencies = ["Bridge"]