I'm trying to call a function of my contract using ethers.js. If I call the function on a contract deployed on my localhost network I get this error:
Error: Transaction reverted: function selector was not recognized and there's no fallback function
The error doesn't occur if I switch to a real network.
Since I want to test my contract on my local hardhat network, do you know how to solve this problem?