Skip to content

Commit

Permalink
deploy: Add BondingVotes target deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Oct 13, 2023
1 parent 011c5f3 commit 2c32609
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions deploy/deploy_bonding_votes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {HardhatRuntimeEnvironment} from "hardhat/types"
import {DeployFunction} from "hardhat-deploy/types"

import ContractDeployer from "../utils/deployer"

const PROD_NETWORKS = ["mainnet", "arbitrumMainnet"]

const isProdNetwork = (name: string): boolean => {
return PROD_NETWORKS.indexOf(name) > -1
}

const func: DeployFunction = async function(hre: HardhatRuntimeEnvironment) {
const {deployments, getNamedAccounts} = hre // Get the deployments and getNamedAccounts which are provided by hardhat-deploy

const {deployer} = await getNamedAccounts() // Fetch named accounts from hardhat.config.ts

const contractDeployer = new ContractDeployer(deployer, deployments)
const controller = await contractDeployer.fetchDeployedController()

const deploy = isProdNetwork(hre.network.name) ?
contractDeployer.deploy.bind(contractDeployer) :
contractDeployer.deployAndRegister.bind(contractDeployer)

await deploy({
contract: "BondingVotes",
name: "BondingVotesTarget",
args: [controller.address],
proxy: false // deploying only the target
})
}

func.tags = ["BONDING_VOTES"]
export default func

0 comments on commit 2c32609

Please sign in to comment.