Mock Ready

This commit is contained in:
2024-08-05 18:07:29 +08:00
parent 3ab5ee37c6
commit 39c2dd760b
12 changed files with 6904 additions and 1052 deletions
+33
View File
@@ -0,0 +1,33 @@
// For Localhost, Hardhat, Ganache Without Price Feed To Get Price Feed
const { network } = require("hardhat");
const {
developmentChains,
DECIMALS,
INITIAL_ANSWER,
} = require("../helper-hardhat-config");
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments;
const { deployer } = await getNamedAccounts();
const chainId = network.config.chainId;
const networkName = network.name;
// Don't deploy mock contract to real blockchain with price feed
// Here can chekc with chainId as well
if (developmentChains.includes(networkName)) {
log("Local network '" + networkName + "', deploying mocks...");
await deploy("MockV3Aggregator", {
contract: "MockV3Aggregator",
from: deployer,
log: true,
args: [DECIMALS, INITIAL_ANSWER],
});
log("Mocks deployed!");
log("=====================================");
}
};
module.exports.tags = ["all", "mocks"];