PatrickAlphaC / hardhat-fund-me-fcc

82 stars 182 forks source link

TypeError: getNamedAcccounts is not a function #157

Closed nzarambaelisa closed 1 year ago

nzarambaelisa commented 1 year ago

Question? i'm trying to deploy a mockERC20 contract, but it is throwing an error getNamedAcccounts is not a function. how do solve the problem? here is the deployment of the contract

const { network } = require("hardhat")
const { developmentChains } = require("../helper-hardhat-config")

module.exports = async ({ getNamedAcccounts, deployments }) => {
    const { deploy } = deployments
    const { deployer } = await getNamedAcccounts()
    const chainId = network.config.chainId

    if (chainId == 31337) {
        log("Local network detected! Deploying mocks...")
        await deploy("RewardToken", {
            from: deployer,
            log: true,
            args: [],
        })
        log("Mocks deployed!")
        log("-------------------------------------------")
    }
}

module.exports.tags = ["all", "token"]
PatrickAlphaC commented 1 year ago

Can you:

  1. Make this a discusson on the full repo? https://github.com/smartcontractkit/full-blockchain-solidity-course-js/

Thanks!