Error: ERROR processing /home/blayne/hardhat-fund-me/deploy/00-deploy-mock.js: TypeError: from.toLowerCase is not a function #2491
-
Hey, I'm getting an error I don't understand. There is no where in my code that I used the .toLowercase, so I very confused as to why I am getting this error Anyone please help const { network } = require("hardhat")
const {
developmentChains,
DECIMALS,
INITIAL_ANSWER,
} = require("../helper-hardhat-config")
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const deployer = await getNamedAccounts()
if (developmentChains.includes(network.name)) {
log("local network detected! Deploying mocks...")
await deploy("MockV3Aggregator", {
contract: "MockV3Aggregator",
from: deployer,
log: true,
args: [DECIMALS, INITIAL_ANSWER],
})
log("Mocks deployed!")
log(
"----------------------------------------------------------------------"
)
}
}
module.exports.tags = ["all", "mocks"] |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@blaynejosh enclose The line |
Beta Was this translation helpful? Give feedback.
@blaynejosh enclose
deployer
with{}
change this lineconst deployer = await getNamedAccounts()
toconst {deployer} = await getNamedAccounts()
The line
await getNamedAccounts()
returns thenamedAccounts
object and we need to extractdeployer
from it. So we use the{}
notation.