Random, Upkeep, Mock Ready
This commit is contained in:
@@ -1,20 +1,35 @@
|
||||
const { network } = require("hardhat");
|
||||
const { network, ethers } = require("hardhat");
|
||||
const { developmentChains } = require("../helper-hardhat-config");
|
||||
//require("../contracts/test/VRFCoordinatorV2_5Mock");
|
||||
|
||||
const BASE_FEE = "250000000000000000"; // 0.25 is this the premium in LINK?
|
||||
const GAS_PRICE_LINK = 1e9; // link per gas, is this the gas lane? // 0.000000001 LINK per gas
|
||||
// 0.25 or 250000000000000000 is this the premium in LINK
|
||||
const BASE_FEE = ethers.utils.parseEther("0.25");
|
||||
// link per gas, is this the gas lane? // 0.000000001 LINK per gas
|
||||
const GAS_PRICE_LINK = 1e9;
|
||||
// This should be the conversion rate between Wei and LINK
|
||||
const WEI_PRE_UNIT_LINK = ethers.utils.parseUnits("1", "ether");
|
||||
|
||||
module.exports = async ({ getNamedAccounts, deployments }) => {
|
||||
const { deploy, log } = deployments;
|
||||
const { deployer } = await getNamedAccounts();
|
||||
const chainId = network.config.chainId;
|
||||
|
||||
// If we are on a local development network, we need to deploy mocks!
|
||||
if (chainId == 31337) {
|
||||
log("Local network detected! Deploying mocks...");
|
||||
|
||||
/* // Deprecated
|
||||
await deploy("VRFCoordinatorV2Mock", {
|
||||
from: deployer,
|
||||
log: true,
|
||||
args: [BASE_FEE, GAS_PRICE_LINK],
|
||||
});
|
||||
*/
|
||||
await deploy("VRFCoordinatorV2_5Mock", {
|
||||
from: deployer,
|
||||
log: true,
|
||||
args: [BASE_FEE, GAS_PRICE_LINK, WEI_PRE_UNIT_LINK],
|
||||
});
|
||||
|
||||
log("Mocks Deployed!");
|
||||
log("----------------------------------------------------------");
|
||||
|
||||
Reference in New Issue
Block a user