[SOLVED] Metamask Internal Json -Rpc error, code : -32603

I’ve been working on nftMarketplace. But every time I try to buy an nft it gives out the error.
I’m using react-moralis and its hooks to integrate the buying functionality.
Here is how I implemented my useWeb3Contract() hook to call buyItems function on marketplace.

  const { runContractFunction: buyItem } = useWeb3Contract({
    abi: NftMarketPlaceABI,
    contractAddress: marketplaceAddress,
    functionName: 'buyItem',
    msgValue: price,
    params: {
      nftAddress: nftAddress,
      tokenId: tokenId,
      amount: 1,
    },
  });

Is this some issue with how I’m implementing the hook or something else. Because my wallet is connected to the front end while this function is called.

Make sure your wallet is on the right chain where the marketplace contract is. If you verify your contract on the contract’s chain explorer e.g. *.etherscan.io, you can test this buyItem function directly on there to make sure it works.

Yup I already tried these steps. My wallet is on mumbai chain as expected. And the contract is here and I already tried buyItem on this marketplace twice.

You tried directly on mumbai.polygonscan.com and you get the same error?

Nope but I found the issue it was within the cloud function I created to handle the database in moralisDB

1 Like