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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* Imports: External */
import { ethers } from 'ethers'
import { task } from 'hardhat/config'
import * as types from 'hardhat/internal/core/params/argumentTypes'
task('deploy-teleportr-l1')
.addParam(
'minDepositAmountEth',
'Minimum deposit amount, in ETH.',
undefined,
types.string
)
.addParam(
'maxDepositAmountEth',
'Maximum deposit amount, in ETH.',
undefined,
types.string
)
.addParam(
'maxBalanceEth',
'Maximum contract balance, in ETH.',
undefined,
types.string
)
.addOptionalParam(
'numDeployConfirmations',
'Number of confirmations to wait for each transaction in the deployment. More is safer.',
1,
types.int
)
.setAction(
async (
{
minDepositAmountEth,
maxDepositAmountEth,
maxBalanceEth,
numDeployConfirmations,
},
hre: any
) => {
const { deploy } = hre.deployments
const { deployer } = await hre.getNamedAccounts()
console.log('Deploying TeleportrDeposit... ')
await deploy('TeleportrDeposit', {
from: deployer,
args: [
ethers.utils.parseEther(minDepositAmountEth),
ethers.utils.parseEther(maxDepositAmountEth),
ethers.utils.parseEther(maxBalanceEth),
],
log: true,
waitConfirmations: numDeployConfirmations,
})
console.log('Done.')
}
)
task('deploy-teleportr-l2').setAction(
async ({ numDeployConfirmations }, hre: any) => {
const { deploy } = hre.deployments
const { deployer } = await hre.getNamedAccounts()
console.log('Deploying TeleportrDisburser... ')
await deploy('TeleportrDisburser', {
from: deployer,
args: [],
log: true,
waitConfirmations: numDeployConfirmations,
})
console.log('Done.')
}
)