forked from keep-network/tbtc-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path19_authorize_spv_maintainer_in_bridge.ts
31 lines (26 loc) · 1.11 KB
/
19_authorize_spv_maintainer_in_bridge.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
import { HardhatRuntimeEnvironment } from "hardhat/types"
import { DeployFunction } from "hardhat-deploy/types"
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { getNamedAccounts, deployments } = hre
const { execute } = deployments
const { deployer, spvMaintainer } = await getNamedAccounts()
await execute(
"Bridge",
{ from: deployer, log: true, waitConfirmations: 1 },
"setSpvMaintainerStatus",
spvMaintainer,
true
)
}
export default func
func.tags = ["AuthorizeSpvMaintainer"]
func.dependencies = ["Bridge"]
// SPV maintainer can submit SPV proofs to the Bridge. We authorize spvMaintainer
// account for Hardhat network (unit tests) and Goerli (testnet) but we DO NOT
// want to authorize it for Mainnet deployment. SPV maintainer will be authorized
// separately by the Governance when sweeping will be activated.
//
// Note that at this point MaintainerProxy contract is already authorized in the
// Bridge (see AuthorizeMaintainerProxyInBridge tag).
func.skip = async (hre: HardhatRuntimeEnvironment): Promise<boolean> =>
hre.network.name === "mainnet"