0

Error Image

Solution found online

const submitHandler = async (e) => {
    e.preventDefault();
    
    // handleMint();
    const provider = new ethers.providers.Web3Provider(window.ethereum);

    const signer = provider.getSigner();
    
    const erc20 = new ethers.Contract("0xbe3ccbfc866b16bd983b795b6ffa8c0f98b2540e", Abi, signer);
    // const tokenName = await erc20.name();

    const { data } = await axios.get(`/api/products/`);
    // console.log("my data: ",data);
    
    await erc20.createNFT("");  //change krna h 

    let mintId= await erc20.TokenID();

    let tokenId = parseInt(mintId._hex, 16);
    console.log(tokenId);

    // const check = await erc20.ownerOf(tokenId);
    // console.log(check);

    try{
      await erc20.listNFT(tokenId, price); //added for sale
    }catch(err){
      console.log(err);
    }
    const add3= erc20.ownerOf(tokenId);
    console.log(add3);

    dispatch(createProduct(name, tokenId, price, warranty, description, image, countInStock));
  };

I think there is problem with the minting is there any solutions? I am newbie to this field. Thank you.strong text

Liaw
  • 1
  • 1

0 Answers0