Problem Mock & package.json
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
// For Localhost, Hardhat, Ganache Without Price Feed To Get Price Feed
|
||||
|
||||
const { ethers, run, network } = require("hardhat");
|
||||
|
||||
module.exports = async ({ getNamedAccounts, deployments }) => {
|
||||
const { deploy, log } = deployments;
|
||||
const { deployer } = await getNamedAccounts();
|
||||
const chainId = network.config.chainId;
|
||||
};
|
||||
@@ -6,18 +6,28 @@ const { networkConfig } = require("../helper-hardhat-config");
|
||||
const networkConfig = helperConfig.networkConfig;
|
||||
*/
|
||||
|
||||
// main function
|
||||
//function deployFunc() {
|
||||
// const {getNamedAccounts, deployments} = hre;
|
||||
// // Same as hre.getNamedAccounts & hre.deployments
|
||||
//}
|
||||
//module.exports.default = deployFunc;
|
||||
/*
|
||||
// main function that auto run via hardhat deploy
|
||||
function deployFunc() {
|
||||
const { getNamedAccounts, deployments } = hre; // Hardhat runtime environment
|
||||
// Same as hre.getNamedAccounts & hre.deployments
|
||||
console.log("Hello World!");
|
||||
}
|
||||
module.exports.default = deployFunc;
|
||||
*/
|
||||
|
||||
module.exports = async ({ getNamedAccounts, deployments }) => {
|
||||
const { deploy, log } = deployments;
|
||||
const { deployer } = await getNamedAccounts();
|
||||
const { deployer } = await getNamedAccounts(); // Take from hardhat.config.js namedAccounts
|
||||
const chainId = network.config.chainId;
|
||||
|
||||
if (networkConfig[chainId] === undefined) {
|
||||
console.log("Is Not Testnet / Mainnet! No Mock Up...");
|
||||
console.log(deployments);
|
||||
const ethUsdAggregator = await deployments.get("MockV3Aggregator");
|
||||
return;
|
||||
}
|
||||
|
||||
const ethUsdPriceFeedAddress = networkConfig[chainId]["ethUsdPriceFeed"];
|
||||
|
||||
// if contract doest't exist, we deploy a minimal version for our local testing
|
||||
|
||||
Reference in New Issue
Block a user