-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy path31_deploy_tokenholder_governor.ts
More file actions
49 lines (41 loc) · 1.31 KB
/
31_deploy_tokenholder_governor.ts
File metadata and controls
49 lines (41 loc) · 1.31 KB
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
import { HardhatRuntimeEnvironment } from "hardhat/types"
import { DeployFunction } from "hardhat-deploy/types"
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { getNamedAccounts, deployments, helpers } = hre
const { deployer, thresholdCouncil } = await getNamedAccounts()
// TODO: fail if thresholdCouncil is undefined on mainnet
let vetoer = thresholdCouncil ?? deployer
const T = await deployments.get("T")
const TokenStaking = await deployments.get("TokenStaking")
const TokenholderTimelock = await deployments.get("TokenholderTimelock")
const timelock = await deployments.deploy("TokenholderGovernor", {
from: deployer,
args: [
T.address,
TokenStaking.address,
TokenholderTimelock.address,
vetoer,
],
log: true,
})
if (hre.network.tags.etherscan) {
await hre.ethers.provider.waitForTransaction(
timelock.transactionHash,
5,
300000
)
await helpers.etherscan.verify(
timelock,
"contracts/governance/TokenholderGovernor.sol:TokenholderGovernor"
)
}
if (hre.network.tags.tenderly) {
await hre.tenderly.verify({
name: "TokenholderGovernor",
address: timelock.address,
})
}
}
export default func
func.tags = ["TokenholderGovernor"]
func.dependencies = ["TokenStaking"]