-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy path09_deploy_bridge_governance.ts
50 lines (41 loc) · 1.35 KB
/
09_deploy_bridge_governance.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
44
45
46
47
48
49
50
import { HardhatRuntimeEnvironment } from "hardhat/types"
import { DeployFunction } from "hardhat-deploy/types"
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts, helpers } = hre
const { deploy } = deployments
const { deployer } = await getNamedAccounts()
const Bridge = await deployments.get("Bridge")
const bridgeGovernanceParameters = await deployments.deploy(
"BridgeGovernanceParameters",
{
from: deployer,
log: true,
waitConfirmations: 1,
}
)
// 60 seconds for Sepolia. 48 hours otherwise.
const GOVERNANCE_DELAY = hre.network.name === "sepolia" ? 60 : 172800
const bridgeGovernance = await deploy("BridgeGovernance", {
contract: "BridgeGovernance",
from: deployer,
args: [Bridge.address, GOVERNANCE_DELAY],
log: true,
libraries: {
BridgeGovernanceParameters: bridgeGovernanceParameters.address,
},
waitConfirmations: 1,
})
if (hre.network.tags.etherscan) {
await helpers.etherscan.verify(bridgeGovernanceParameters)
await helpers.etherscan.verify(bridgeGovernance)
}
if (hre.network.tags.tenderly) {
await hre.tenderly.verify({
name: "BridgeGovernance",
address: bridgeGovernance.address,
})
}
}
export default func
func.tags = ["BridgeGovernance"]
func.dependencies = ["Bridge"]