-
Notifications
You must be signed in to change notification settings - Fork 512
Expand file tree
/
Copy path04_Deploy_KeepersCounter.js
More file actions
41 lines (39 loc) · 1.67 KB
/
04_Deploy_KeepersCounter.js
File metadata and controls
41 lines (39 loc) · 1.67 KB
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
const { getNamedAccounts, deployments, network } = require("hardhat")
const {
networkConfig,
developmentChains,
VERIFICATION_BLOCK_CONFIRMATIONS,
} = require("../helper-hardhat-config")
const { verify } = require("../helper-functions")
module.exports = async ({ getNamedAccounts, deployments, getChainId }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
const keepersUpdateInterval = networkConfig[chainId]["keepersUpdateInterval"] || "30"
const multiplierEnabled = networkConfig[chainId]['multiplierEnabled'] || true
// Price Feed Address, values can be obtained at https://docs.chain.link/docs/reference-contracts
// Default one below is ETH/USD contract on Kovan
const waitBlockConfirmations = developmentChains.includes(network.name)
? 1
: VERIFICATION_BLOCK_CONFIRMATIONS
const args = [keepersUpdateInterval, multiplierEnabled]
const keepersCounter = await deploy("KeepersCounter", {
from: deployer,
args: args,
log: true,
waitConfirmations: waitBlockConfirmations,
})
if (!developmentChains.includes(network.name) && process.env.ETHERSCAN_API_KEY) {
log("Verifying...")
await verify(keepersCounter.address, args)
}
log(
"Head to https://keepers.chain.link/ to register your contract for upkeeps. Then run the following command to track the counter updates: "
)
const networkName = network.name == "hardhat" ? "localhost" : network.name
log(
`yarn hardhat read-keepers-counter --contract ${keepersCounter.address} --network ${networkName}`
)
log("----------------------------------------------------")
}
module.exports.tags = ["all", "keepers"]