I am getting an error code when trying to deploy to sepolia testnet #5219
-
Can someone please tell me what's this error and how to correct it?
This is my hardhat.config script below: require("@nomicfoundation/hardhat-toolbox")
require("hardhat-deploy")
require("dotenv").config()
require("@nomiclabs/hardhat-etherscan")
require("solidity-coverage")
require("hardhat-gas-reporter")
/** @type import('hardhat/config').HardhatUserConfig */
const SEPOLIA_RPC_URL = process.env.SEPOLIA_RPC_URL
const SEPOLIA_PRIVATE_KEY = process.env.SEPOLIA_PRIVATE_KEY
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY
module.exports = {
solidity: {
compilers: [{ version: "0.8.8" }, { version: "0.6.6" }],
},
defaultNetwork: "hardhat",
networks: {
sepolia: {
url: SEPOLIA_RPC_URL,
accouts: [SEPOLIA_PRIVATE_KEY],
chainID: 11155111,
blockConfirmatiions: 6,
},
},
gasReporter: {
enabled: true,
currency: "USD",
outputFile: "gas-report.txt",
noColors: true,
coinmarketcap: COINMARKETCAP_API_KEY,
},
namedAccounts: {
deployer: {
default: 0,
},
},
etherscan: {
apiKey: ETHERSCAN_API_KEY,
},
} And this is my deploy script below: const { networkConfig, developmentChains } = require("../helper-hardhat-config")
const { network } = require("hardhat")
const { verify } = require("../utils/verify")
// Pulling getNamedAccounts and deployments from hre
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainID = network.config.chainID
let ethToUsPriceFeedAddress
if (developmentChains.includes(network.name)) {
const ethUsdAggregator = await deployments.get("MockV3Aggregator")
ethToUsPriceFeedAddress = ethUsdAggregator.address
} else {
ethToUsPriceFeedAddress = networkConfig[chainID]["ethToUsPriceFeed"]
}
const args = [ethToUsPriceFeedAddress]
// when going for localHost or hardhat network we want to use a mock
const FundMe = await deploy("FundMe", {
from: deployer,
args: args,
log: true,
waitConfirmations: network.config.blockConfirmations || 1,
})
if (
!developmentChains.includes(network.name) &&
process.env.ETHERSCAN_API_KEY
) {
await verify(FundMe.address, args)
}
log("-------------------------------------------------------------------")
}
module.exports.tags = ["all", "fundme"] |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Apr 3, 2023
Replies: 1 comment 1 reply
-
@CoderB01 here typo in sepolia: {
url: SEPOLIA_RPC_URL,
accounts: [SEPOLIA_PRIVATE_KEY],
chainId: 11155111,
blockConfirmatiions: 6,
}, |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
CoderB01
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@CoderB01 here typo in
accounts
andchainId