This is a third-party plugin. Please report issues in its GitHub Repository
Allows changing the current network in Hardhat.
Useful for multi-chain projects, where switching between two networks in a script may be desirable.
Warning: This is a bit of a hack, some modules may break.
yarn add hardhat-change-network
Import the plugin in your
Or if you are using TypeScript, in your
Change the network to any network defined in hardhat.config.js with this simple call:
You can also use this library to retrieve a standard web3 provider object for a given network:
const provider = hre.getProvider('goerli');