1

Facing this error => MetaMask - RPC Error: execution reverted {code: -32000, message: "execution reverted"} after calling the contract method. This is called via the useEffect hook in the React App.

Once the fetch button is hit, it's supposed to call the contract method, but it gives the error.

Can someone tell me why this occurs and also help me fix this issue?

The link to the github repo => https://github.com/SwaroopBS/DApp_React.git

error displayed in the console

1
  • I wonder could you find the solution for this?
    – whyeverwhy
    Aug 11, 2021 at 20:43

2 Answers 2

1

I found the solution at least for me. If you are using the old CDNs, please upgrade them to; https://cdn.jsdelivr.net/npm/[email protected]/dist/ethjs.min.js https://cdnjs.cloudflare.com/ajax/libs/web3/1.5.2/web3.min.js

0

I had the same problem and I compiled my .sol code more than once and I didn't updated the deployed address, but after updating the deployed address my code worked.

Your Answer

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

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