Lesson 7 : one or many errors in config file while deploying on rinkbey #1633
-
Error in config file while deploying on testnet rinkbeyit says "* Invalid account: #0 for network: rinkbey - private key too short, expected 32 bytes" my config fileconst { default: Ethers } = require("@typechain/ethers-v5")
require("@nomicfoundation/hardhat-toolbox")
require("hardhat-deploy")
const RINKBEY_RPC_URL = process.env.RINKBEY_RPC_URL
const PRIVATE_KEY = process.env.PRIVATE_KEY
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY
const ETHERSCAN_API_KEY = process.nextTick.ETHERSCAN_API_KEY
module.exports = {
// solidity: "0.8.8",
solidity: {
compilers:[{version: "0.8.8"},{version: "0.6.6"}],
},
defaultNetwork: "hardhat",
networks: {
rinkbey: {
url: "RINKBEY_RPC_URL",
accounts: [PRIVATE_KEY],
chainId: 4,
blockConfirmations: 6,
},
},
gasReporter: {
enabled: false,
outputFile: "gas-report.txt",
noColors: true,
currency: "USD",
coinmarketcap: COINMARKETCAP_API_KEY,
token: "MATIC",
},
etherscan:{
apiKey: ETHERSCAN_API_KEY
},
namedAccounts: {
deployer: {
default: 0, //this says that by default the 0th account is deployer
},
player: {
default: 1,
}
},
}
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@yash-2138 Make sure you have |
Beta Was this translation helpful? Give feedback.
-
All that @alymurtazamemon has said above plus make sure you use |
Beta Was this translation helpful? Give feedback.
@yash-2138 Make sure you have
env
dependency installed and you are missing this inside the hardhat.config.js filerequire("dotenv").config();
. And also make sure that variable names inside.env
file and all other places are same.