-
All .sol files compiled successfully (FundMe, PriceConverter and MockV3Aggregator). However, I am getting this error when trying to deploy mocks. Error details: Error: ERROR processing /Users/ns/Blockchain/hardhat-fund-me-fcc/deploy/00-deploy-mocks.js: //creating own 'fake' priceFeed contract so we can test everything locally
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "@chainlink/contracts/src/v0.6/tests/MockV3Aggregator.sol"; hardhat.config.js require("@nomicfoundation/hardhat-toolbox")
require("hardhat-deploy")
require("@nomicfoundation/hardhat-toolbox")
require("dotenv").config()
require("@nomiclabs/hardhat-etherscan")
require("hardhat-gas-reporter")
require("@nomiclabs/hardhat-ethers")
const { getUsedIdentifiers } = require("typechain")
/** @type import('hardhat/config').HardhatUserConfig */
const RINKEBY_RPC_URL = process.env.RINKEBY_RPC_URL
const K = process.env.KEY
const ETHK = process.env.ETHKEY
module.exports = {
defaultNetwork: "hardhat",
//solidity: "0.8.8",
solidity: {
compilers: [
{ version: "0.8.8" },
{ version: "0.8.7" },
{ version: "0.6.6" },
],
},
networks: {
rinkeby: {
url: RINKEBY_RPC_URL,
accounts: [K],
chainId: 4,
},
localhost: {
url: "http://127.0.0.1:8545/",
chainId: 31337,
},
},
etherscan: {
apiKey: ETHK,
},
gasReporter: {
enabled: true,
currency: "USD",
coinmarketcap: "762a7a9c-ad66-4385-93fd-75d4d1fbd17a",
token: "ETH",
},
namedAccounts: {
deployer: {
default: 0,
},
player: {
default: 1,
},
},
} helper-hardhat-config.js const networkConfig = {
31337: {
name: "localhost",
},
4: {
name: "rinkeby",
ethUsdPriceFeed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e",
blockConfirmations: 6,
},
137: {
name: "polygon",
ethUsdPriceFeed: "0xF9680D99D6C9589e2a93a78A04A279e509205945",
},
}
const developmentChain = ["hardhat", "localhost"]
const DECIMALS = 8
const INITIAL_ANSWER = 200000000000
module.exports = { networkConfig, developmentChain } 00-deploy-mocks.js const { network } = require("hardhat")
const { developmentChain } = require("../helper-hardhat-config")
const DECIMAL = 8
const INITIAL_ANSWER = 200000000
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
if (developmentChain.includes(network.name)) {
log("Local network detected!")
await deploy("MockV3Aggregator", {
contract: MockV3Aggregator,
from: deployer,
log: true,
arguments: [DECIMAL, INITIAL_ANSWER],
})
log("LOGGGING MOCKS DEPLOYED")
log("******************************************")
}
}
//running specific deploy scripts using tags
module.exports.tags = ["all", "mocks"] |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
it's now working. Found out that I wrote 'arguments' instead of 'args' in 00-deploy-mocks.js if (developmentChain.includes(network.name)) {
log("Local network detected!")
await deploy("MockV3Aggregator", {
contract: MockV3Aggregator,
from: deployer,
log: true,
arguments: [DECIMAL, INITIAL_ANSWER], // changed it to **args**
})
log("LOGGGING MOCKS DEPLOYED")
log("******************************************")
} |
Beta Was this translation helpful? Give feedback.
it's now working. Found out that I wrote 'arguments' instead of 'args' in 00-deploy-mocks.js