最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ethereum - Adding Ignition module in HardhatUserConfig - Stack Overflow

programmeradmin2浏览0评论

I'm creating my first project for etherum tokens. This project was initialized with Typescript+Viem+Hardhat.

After creating some contracts, I wrote an Ignition module. Then, I was about writing the hardhat.config.ts file but I'm having an issue. This is my current implementation:

import type { HardhatUserConfig } from "hardhat/config";
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-ethers";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "solidity-coverage";
import "@nomicfoundation/hardhat-ignition";
import MyModule from "./ignition/modules/MyModule";

const INFURA_PROJECT_ID = "YOUR_INFURA_PROJECT_ID";
const PRIVATE_KEY = "YOUR_PRIVATE_KEY";

const config: HardhatUserConfig = {
    solidity: "0.8.28",
    networks: {
        ropsten: {
            url: `/${INFURA_PROJECT_ID}`,
            accounts: [PRIVATE_KEY]
        }
    },
    typechain: {
        outDir: "typechain",
        target: "ethers-v6",
    },
    ignition: {}
};

export default config;

Within ignition, Copilot proposes me to write:

ignition: {
    modules: [MyModule]
}

but then I see the following error:

Object literal may only specify known properties, and 'modules' does not exist in type 'Partial & { strategyConfig?: Partial | undefined; }'.ts(2353) type-extensions.d.ts(48, 9): The expected type comes from property 'ignition' which is declared here on type 'HardhatUserConfig'

发布评论

评论列表(0)

  1. 暂无评论