Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I can create a provider fairly easily to Rinkeby, Ropsten and the other testnets but I can't seem to figure out how to create a provider that connects to a hardhat mainnet fork.
In hardhat, I suppose you must have enabled mainnet forking already
Then, you can get the ethers provider by using hre.ethers.provider in your code.
Required, but never shown