hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Boilerplate error: the transaction is executed but errors are printed in the HH node

Open ChristopherDedominici opened this issue 1 year ago • 6 comments

Version of Hardhat

latest

What happened?

Download the boilerplate repository Then, follow the steps explained in the documentation at https://hardhat.org/tutorial/boilerplate-project. Using MetaMask (I haven't tested with Coinbase Wallet), the transaction executes correctly. However, several errors are printed in the Hardhat node:

eth_call
  Contract call:       Token#<unrecognized-selector>
  From:                0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
  To:                  0x5fbdb2315678afecb367f032d93f642f64180aa3

  Error: Transaction reverted: function selector was not recognized and there's no fallback function
      at Token.<unrecognized-selector> (contracts/Token.sol:12)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at HardhatNode.runCall (/home/chris/repos/NomicFoundation/tests_folder/dapp/node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:718:7)
      at EthModule._callAction (/home/chris/repos/NomicFoundation/tests_folder/dapp/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:365:9)
      at HardhatNetworkProvider._sendWithLogging (/home/chris/repos/NomicFoundation/tests_folder/dapp/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:145:22)
      at HardhatNetworkProvider.request (/home/chris/repos/NomicFoundation/tests_folder/dapp/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:122:18)
      at JsonRpcHandler._handleRequest (/home/chris/repos/NomicFoundation/tests_folder/dapp/node_modules/hardhat/src/internal/hardhat-network/jsonrpc/handler.ts:191:20)
      at JsonRpcHandler._handleSingleRequest (/home/chris/repos/NomicFoundation/tests_folder/dapp/node_modules/hardhat/src/internal/hardhat-network/jsonrpc/handler.ts:152:17)

ChristopherDedominici avatar Feb 23 '24 15:02 ChristopherDedominici

Did I misunderstand our conversation or did we think that we need a change in metamask before we can progress this?

kanej avatar Feb 26 '24 09:02 kanej

Out of band we have discussed this. This issue is likely interacting with internals we are reworking with EDR. We are going to hold until EDR is merged, then we can leverage the EDR teams knowledged here.

kanej avatar Feb 26 '24 10:02 kanej

Out of band we have discussed this.

Hi, @kanej , I am interest with EDR, what is the links of you guys talk. Thanks in advance.

jwbda avatar Mar 28 '24 03:03 jwbda

Out of band we have discussed this.

Hi, @kanej , I am interest with EDR, what is the links of you guys talk. Thanks in advance.

I am afraid that while there was a Devconnect talk on EDR it wasn't recorded due to technical issues. So there is currently no talk.

You can follow along with the project at https://github.com/orgs/NomicFoundation/projects/3

kanej avatar Mar 28 '24 09:03 kanej

This issue is important because the error shows up in Hardhat's boilerplate project.

kanej avatar Apr 02 '24 09:04 kanej

This is caused by MetaMask calling supportsInterface(bytes4) on the token, which doesn't implement that method.

To fix it, the example token should implement EIP-165.

Closing because there's nothing to do on the EDR side.

fvictorio avatar May 16 '24 09:05 fvictorio