import { HardhatRuntimeEnvironment , HttpNetworkConfig } from "hardhat/types" ; export async function forkMainnet ( hre ) { await hre . network . provider . request ( { method : "hardhat_reset" , params : [ { forking : { jsonRpcUrl : ( hre . config . networks [ "mainnet" ] as HttpNetworkConfig ) . url , blockNumber : undefined , } , } , ] , } ) ; } export async function stopMainnetFork ( hre ) { await hre . network . provider . request ( { method : "hardhat_reset" , params : [ ] , } ) ; }