dabit3 / polygon-ethereum-nextjs-marketplace

A full stack digital marketplace running on Ethereum with Polygon & Next.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

contract.getListingPrice() Not woking it throws a Error always.

NaitikDartexon opened this issue · comments

const price = ethers.utils.parseUnits(formInput.price, 'ether')
let contract = new ethers.Contract(marketplaceAddress, NFTMarketplace.abi, signer)
let listingPrice = await contract.getListingPrice()

in that above code when i try to log the listing price i got the error

image

Can anyone please help me in that how to resolve it.

commented

I had the same problem, and I solved it by making sure that you're Metamask wallet should be connected to the same network where you deployed your smart contract. If you deployed your smart contract locally make sure that your metamask wallet is connected to Localhost8545 when Interacting when the smart contract.