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
Best Answer
I found the solution at least for me. If you are using the old CDNs, please upgrade them to; https://cdn.jsdelivr.net/npm/ethjs@0.4.0/dist/ethjs.min.js https://cdnjs.cloudflare.com/ajax/libs/web3/1.5.2/web3.min.js