As per MadBreaks comment, Hardhat is better organised to keep things internal (ie. provide defaults) including not needing to bring in ...-waffle
yourself.
You should just require this in the hardhat.config.[js|ts]
as per https://hardhat.org/hardhat-runner/docs/guides/project-setup:
(typescript)
import "@nomicfoundation/hardhat-toolbox";
(JavaScript)
require("@nomicfoundation/hardhat-toolbox");
And these will bring in:
(Typescript)
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomicfoundation/hardhat-ethers";
import "@nomicfoundation/hardhat-verify";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "solidity-coverage";
(JavaScript)
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomicfoundation/hardhat-ethers");
require("@nomicfoundation/hardhat-verify");
require("@typechain/hardhat");
require("hardhat-gas-reporter");
require("solidity-coverage");
And hardhat-ethers
is what you need. Specifically it is (type-extensions.d.ts
):
(Typescript)
import type { ethers } from "ethers";
import type { FactoryOptions as FactoryOptionsT, getContractFactory as getContractFactoryT, HardhatEthersHelpers, Libraries as LibrariesT } from "../types";
import "hardhat/types/runtime";
declare module "hardhat/types/runtime" {
interface HardhatRuntimeEnvironment {
ethers: typeof ethers & HardhatEthersHelpers;
}
type Libraries = LibrariesT;
type FactoryOptions = FactoryOptionsT;
type getContractFactory = typeof getContractFactoryT;
}
//# sourceMappingURL=type-extensions.d.ts.map