Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Can't mint on Goerli network #21

Open
kadiemq opened this issue Oct 31, 2022 · 0 comments
Open

Can't mint on Goerli network #21

kadiemq opened this issue Oct 31, 2022 · 0 comments

Comments

@kadiemq
Copy link

kadiemq commented Oct 31, 2022

Here is MintAndListen script:

import { ethers } from "hardhat";
import { NFTMarketPlace } from "../typechain-types";
import { BasicNft } from "../typechain-types/contracts/test";

async function MintAndList() {
    const NFTMarketplace: NFTMarketPlace = await ethers.getContract(
        "NFTMarketPlace"
    );
    const BasicNFT: BasicNft = await ethers.getContract("BasicNft");
    const price = ethers.utils.parseEther("0.1");

    console.log("minting....");
    const mintTx = await BasicNFT.mintNft();
    const mintReciept = await mintTx.wait(1);

    console.log("approving....");
    const tokenId = mintReciept.events![0].args!.tokenId;
    const approveTx = await BasicNFT.approve(NFTMarketplace.address, tokenId);
    await approveTx.wait(1);

    console.log("listing....");
    const listTx = await NFTMarketplace.listItem(
        BasicNFT.address,
        tokenId,
        price
    );
    await listTx.wait(1);
    console.log("done");
}

MintAndList()
    .then(() => process.exit(0))
    .catch((e) => {
        console.log(e);
        process.exit(1);
    });

I'm stuck at minting.... here is the address for the BasicNFT contract https://goerli.etherscan.io/address/0x77F7dbCf23f8Bb05A22F70615F61FdBF47382017 I've tried using hardhat localhost and it's working fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant