Closed shawnesquivel closed 1 year ago
I tried referencing this solution:
https://github.com/PatrickAlphaC/hardhat-fund-me-fcc/issues/28
by using this in hardhat.config.js, but unfortunately I'm getting the same error.
module.exports = {
...
namedAccounts: {
deployer: {
default: 0,
},
users: {
default: 0,
},
},
}
Fixed. Since {deployer} was undefined, I looked up how getNamedAccounts is working. Simple syntax error!
const { deployer } = await getNamedAccounts
returns an AsyncFunction. Odd. Wait - I'm not even calling the function!! Changed to this:
const { deployer } = await getNamedAccounts()
when trying to deploy the 00-mocks-.js script, I get the following error:
From my understanding, when grab the deployer from getNamedAccounts, it will use the namedAccounts in the hardhat.config.js. So I made sure that the deployer had a default of 0.
00-deploy-mocks.js
if I add
it shows that deployer is undefined, so there must be an issue with getNamedAccounts which gets the namedAccounts from hardhat.config.js
hardhat.config.js - made sure namedAccounts.deployer had a default of 0
package.json - same as in GitHub repo https://github.com/PatrickAlphaC/hardhat-fund-me-fcc/blob/main/package.json