I'm using the hardhat-deploy plugin to deploy the contracts, the plugin successfully deployed the two contracts but, not performing the same this time, what I've done is...
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types"
import { ethers } from "hardhat";
import { VOTING_DELAY, QUORUM_PERCENTAGE, VOTING_PERIOD } from "../helperHardhatConfig";
const deployGovernorContract: DeployFunction = async function(hre: HardhatRuntimeEnvironment){
const { getNamedAccounts, deployments, network } = hre;
const { deploy, log, get } = deployments;
//grabbing from config
const { deployer } = await getNamedAccounts();
const governanceToken = await get("GovernanceToken");
const timeLock = await get("Timelock");
log("deploying governor>>>>>>>>>>");
const governorContract = await deploy("GovernorContract", {
from: deployer,
args: [
//governanceToken.address,
timeLock.address,
VOTING_DELAY,
VOTING_PERIOD,
QUORUM_PERCENTAGE
],
log: true,
});
}
export default deployGovernorContract;
It is throwing the error at lines const governanceToken = await get("GovernanceToken");
and const timeLock = await get("Timelock");
. "GovernanceToken", and "Timelock" are the already deployed contracts. The error says...
Error: ERROR processing /home/adil/Desktop/MakingDAO/deploy/deployGovernor.ts:
Error: No deployment found for: GovernanceToken
at get (/home/adil/Desktop/MakingDAO/node_modules/hardhat-deploy/src/DeploymentsManager.ts:162:17)
When I followed the error in MakingDAO/node_modules/hardhat-deploy/src/DeploymentsManager.ts:162:17
exactly here, I got this...
get: async (name: string) => {
await this.setup(false);
const deployment = this.db.deployments[name];
if (deployment === undefined) {
throw new Error(`No deployment found for: ${name}`);
}
return deployment;
},
Actually it is not getting the deployed contract.