0

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.

1
  • 1
    On Metamask go to Settings->Advance->Reset account, sometimes with forking the nonces dont match so that happens.
    – Julissa DC
    Nov 17, 2021 at 20:19

1 Answer 1

0

I encountered this error and what solved it for me is that i reset my Metamask

setting -> Advance-> Reset account

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    May 30, 2022 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.