-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.js
45 lines (32 loc) · 1.22 KB
/
deploy.js
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
const chalk = require('chalk');
const { getChainId } = require('hardhat');
function dim() {
console.log(chalk.dim.call(chalk, ...arguments))
}
function green() {
console.log(chalk.green.call(chalk, ...arguments))
}
module.exports = async (hardhat) => {
console.log("running deploy script")
console.log("network id ", await getChainId())
const { getNamedAccounts, deployments, ethers } = hardhat
const { deploy } = deployments
const { deployer, MultiSig } = await getNamedAccounts()
const namedSigners = await ethers.getNamedSigners()
const deployerSigner = namedSigners.deployer
const batchSize = 5
dim(`deploying PrizePoolRegistry contract from ${deployer}`)
const prizePoolRegistry = await deploy('PrizePoolRegistry', {
args: [],
from: deployer,
skipIfAlreadyDeployed: false
})
green(`Deployed PrizePoolRegistry: ${prizePoolRegistry.address}`)
dim(`deploying PrizeStrategyUpkeep contract from ${deployer}`)
const prizePoolUpkeep = await deploy('PrizeStrategyUpkeep', {
args: [prizePoolRegistry.address, batchSize],
from: deployer,
skipIfAlreadyDeployed: false
})
green(`Deployed PrizeStrategyUpkeep: ${prizePoolUpkeep.address}`)
}