dmihal/hardhat-change-network

Network change doesn't update web3 network provider

Opened this issue · 0 comments

This should be easy to change with the following code:

extendEnvironment((hre) => {
  const Web3 = require("web3");
  hre.Web3 = Web3;

  // hre.network.provider is an EIP1193-compatible provider.
  hre.web3 = new Web3(hre.network.provider);
});