Getting error while deploying the mock contract in the lottery contract section #1695
-
this is my error looks like in my terminal while deploying the lottery smart contract- "Error: No Contract deployed with name VRFCoordinatorV2Mock" const {developmentChains}=require("./helper-hardhat-config");
const{getNamedAccounts, deployments, network, ethers}=require("hardhat");
const baseFee=ethers.utils.parseEther("0.25");
const gasFee= 1e9;
module.exports=async function({getNamedAccounts, deployments}){
const {deploy, log}=deployments;
const {deployer}=await getNamedAccounts();
const chainId=network.config.chainId;
if(chainId=31337/*developmentChains.includes(network.name)*/){
console.log("Local network detected, Deploying Mocks !");
await deploy("VRFCoordinatorV2Mock", {
from: deployer,
log: true,
args: [baseFee, gasFee]
})
}
log("Mocks Deployed");
log("!-------------------------------------------------------------")
}
module.exports.tags=["all", "mocks"] This is my deploy-mock script Please help me ! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
@DeadmanAbir Please give us information so can see the issues. What command did you run? what was the output? show terminal. |
Beta Was this translation helpful? Give feedback.
-
Push to a repo and link it here |
Beta Was this translation helpful? Give feedback.
-
You need to add the The command hardhat deploy only works if the deploy script/file is in the deploy folder and in your case, the file supposed to deploy the VRFCoordinatorV2Mock was not in the deploy folder therefore no |
Beta Was this translation helpful? Give feedback.
You need to add the
deploy-mock.js
file to your deploy folder and rename it as00-deploy-mocks.js
Also, rename the file
deploy-raffle.js
to01-deploy-raffle.js
The command hardhat deploy only works if the deploy script/file is in the deploy folder and in your case, the file supposed to deploy the VRFCoordinatorV2Mock was not in the deploy folder therefore no
VRFCoordinatorV2Mock
contract was deployed.