forked from keep-network/tbtc-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_deploy_light_relay.ts
40 lines (32 loc) · 984 Bytes
/
01_deploy_light_relay.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
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 } = await getNamedAccounts()
function resolveRelayContract() {
if (hre.network.name === "sepolia") {
return "SepoliaLightRelay"
}
if (hre.network.name === "system_tests") {
return "SystemTestRelay"
}
return "LightRelay"
}
const lightRelay = await deployments.deploy("LightRelay", {
contract: resolveRelayContract(),
from: deployer,
log: true,
waitConfirmations: 1,
})
if (hre.network.tags.etherscan) {
await helpers.etherscan.verify(lightRelay)
}
if (hre.network.tags.tenderly) {
await hre.tenderly.verify({
name: resolveRelayContract(),
address: lightRelay.address,
})
}
}
export default func
func.tags = ["LightRelay"]