I have been able to successfully fork the mainnet of Avalanche locally via Hardhat and interact with existing smart contracts.
Starting today though, without any changes in scripts, I tried the exact same thing, starting with npx hardhat node --network hardhat
entered in the terminal and tried wrapping test ETH (Avalanche). The balance did go down but the balane of wETH (wAVAX) in the metamask wallet did not increase.
Then, I tried calling the simple balance function print(contract.functions.balanceOf(address).call())
, which resulted in the following error.
raise BadFunctionCallOutput(msg) from e
web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?
I think I have seen this error a while back when my chain Id was not set correct. But given that my hardhatconfig.ts
worked perfectly fine till yesterday, I am not sure what could have happened.
The call functions and my wrapping scripts do work perfectly on the mainnet.