I’m working with react-moralis and have a runContractFunction:
const { runContractFunction: buyItem, error: buyError } = useWeb3Contract({
abi: nftMarketplaceAbi,
contractAddress: nftMarketplaceAddress,
functionName: "buyItem",
msgValue: price,
params: {
nftAddress: nftAddress,
tokenId: tokenId,
},
})
However, I’m getting an error:
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ]
Is there a way to manually set gas?