forked from keep-network/tbtc-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03_deploy_vending_machine.ts
36 lines (28 loc) · 983 Bytes
/
03_deploy_vending_machine.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
import { HardhatRuntimeEnvironment } from "hardhat/types"
import { DeployFunction } from "hardhat-deploy/types"
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, helpers, getNamedAccounts } = hre
const { deploy } = deployments
const { deployer } = await getNamedAccounts()
const TBTCToken = await deployments.get("TBTCToken")
const TBTC = await deployments.get("TBTC") // tBTC v2
const unmintFee = 0
const vendingMachine = await deploy("VendingMachine", {
from: deployer,
args: [TBTCToken.address, TBTC.address, unmintFee],
log: true,
waitConfirmations: 1,
})
if (hre.network.tags.etherscan) {
await helpers.etherscan.verify(vendingMachine)
}
if (hre.network.tags.tenderly) {
await hre.tenderly.verify({
name: "VendingMachine",
address: vendingMachine.address,
})
}
}
export default func
func.tags = ["VendingMachine"]
func.dependencies = ["TBTCToken", "TBTC"]