UNPKG

@defi-wonderland/keep3r-v2

Version:

The Keep3r Network is a decentralized network for projects that need external devops, and for external teams to find keeper jobs

34 lines (25 loc) 1.24 kB
import { DeployFunction } from 'hardhat-deploy/types'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { KEEP3R_MSIG, KEEP3R_V1, KEEP3R_V1_PROXY, KP3R_WETH_V3_POOL } from './constants'; const deployFunction: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployer } = await hre.getNamedAccounts(); // precalculate the address of Keep3rV2 contract const currentNonce: number = await hre.ethers.provider.getTransactionCount(deployer); const keeperV2Address: string = hre.ethers.utils.getContractAddress({ from: deployer, nonce: currentNonce + 1 }); const keep3rHelperArgs = [keeperV2Address, KEEP3R_MSIG]; const keep3rHelper = await hre.deployments.deploy('Keep3rHelper', { from: deployer, contract: 'solidity/contracts/Keep3rHelper.sol:Keep3rHelper', args: keep3rHelperArgs, log: true, }); const keep3rV2Args = [deployer, keep3rHelper.address, KEEP3R_V1, KEEP3R_V1_PROXY, KP3R_WETH_V3_POOL]; await hre.deployments.deploy('Keep3r', { contract: 'solidity/contracts/Keep3r.sol:Keep3r', from: deployer, args: keep3rV2Args, log: true, }); }; deployFunction.tags = ['deploy-keep3r', 'keep3r', 'mainnet']; export default deployFunction;