const {network, ethers} = require("hardhat");
const { developmentChains } = require("../helper-hardhat-config");
// Test values that don't impact the test workflow
const BASE_FEE = ethers.parseEther("0.25"); // Sepolia set value
const GAS_PRICE_ARG = 1e9; // Setting a value at my own discretion
const WEI_PER_UNIT_LINK = 1e9;
module.exports = async function ({getNamedAccounts, deployments}) {
const {deploy, log} = deployments;
const {deployer} = await getNamedAccounts();
if (developmentChains.includes(network.name)) {
log("Local network detected! Deploying mocks...");
// deploy a mock vrf coordinator)
await deploy("VRFCoordinatorV2_5Mock", {
contract: "VRFCoordinatorV2_5Mock",
from: deployer,
log: true,
args: [BASE_FEE, GAS_PRICE_ARG, WEI_PER_UNIT_LINK]
});
log("Mocks deployed");
log("-----------------------");
}
}
module.exports.tags = ["all", "mocks"];
Basic Information
I tried it in my native environment with hardhat deployment and Remix IDE.
Hardhat local deployment fails while in Remix Cancun I was able to forcibly (I was prompted to confirm my transaction even though my contract was too large) deploy the contract.
This is the snippet of the error that I hit when I run hh deploy
hh deploy
15:16:06 [383/383]
Nothing to compile
Local network detected! Deploying mocks...
An unexpected error occurred:
Error: ERROR processing /home/boss/Projects/hh-fcc/hardhat-smartcontract-lottery-fcc/deploy/00-deploy-mocks.js:
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-
UNPREDICTABLE_GAS_LIMIT ] (reason="Transaction reverted: trying to deploy a contract whose code is too large",method="estimateGas", transaction={"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","data":"0x60e06040526001600e556064600f553480156200001b57600080fd5b50604051620069e7380380620
Description Deployment script for VRFCoordinatorV2_5Mock causes an error that the contract is too large to deploy.
I would appreciate the insight if you have any to be able to use V2.5 contract. Your Environment
Dependencies:
Deploy file:
Basic Information I tried it in my native environment with hardhat deployment and Remix IDE. Hardhat local deployment fails while in Remix Cancun I was able to forcibly (I was prompted to confirm my transaction even though my contract was too large) deploy the contract.
This is the snippet of the error that I hit when I run
hh deploy