whenever I run, “truffle test” I get this error below:
Error: Mnemonic invalid or undefined
at checkBIP39Mnemonic (C:[email protected]:75:15)
at new HDWalletProvider (C:[email protected]:105:23)
at Object.<anonymous> (C:UsersJackctruffle-config.js:17:16)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Function.load (C:UsersJackcAppDataRoamingnpmnode_modulestrufflebuildwebpack:packagesconfigdistindex.js:152:1)
at Function.detect (C:UsersJackcAppDataRoamingnpmnode_modulestrufflebuildwebpack:packagesconfigdistindex.js:144:1)
at Object.module.exports [as run] (C:UsersJackcAppDataRoamingnpmnode_modulestrufflebuildwebpack:packagescorelibcommandstestrun.js:27:1)
at runCommand (C:UsersJackcAppDataRoamingnpmnode_modulestrufflebuildwebpack:packagescorelibcommand-utils.js:297:1)
Truffle v5.11.5 (core: 5.11.5)
Node v20.10.0
https://github.com/aave/flashloan-box
I have all the correct info in my .env but im not sure if I need to add Mnemonic key into my .env file as it doesnt mention that on the Github page? All it uses in the .env is:
INFURA_API_KEY =
DEPLOYMENT_ACCOUNT_KEY =
I am also using require(“dotenv”).config() in my truffle-config.js file.
here is the truffle-config.js
// const path = require("path");
const HDWalletProvider = require("@truffle/hdwallet-provider")
require("dotenv").config()
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration> to customize your Truffle configuration!
// contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
development: {
host: "127.0.0.1",
port: 8545,
// gas: 20000000,
network_id: "*",
skipDryRun: true
},
ropsten: {
provider: new HDWalletProvider(process.env.DEPLOYMENT_ACCOUNT_KEY, "https://ropsten.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 3,
gas: 5000000,
gasPrice: 5000000000, // 5 Gwei
skipDryRun: true
},
kovan: {
provider: new HDWalletProvider(process.env.DEPLOYMENT_ACCOUNT_KEY, "https://kovan.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 42,
gas: 5000000,
gasPrice: 5000000000, // 5 Gwei
skipDryRun: true
},
mainnet: {
provider: new HDWalletProvider(process.env.DEPLOYMENT_ACCOUNT_KEY, "https://mainnet.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 1,
gas: 5000000,
gasPrice: 5000000000 // 5 Gwei
}
},
compilers: {
solc: {
version: "^0.6.6",
},
},
}
Starting to think it might be a dependency issue in my package.json but I am just guessing by this point.
any help would be greatly appreciated!!!