Skip to content

Error on scripts/mint.js #1

@DrKazza

Description

@DrKazza

I think you have the wrong variable on the script:

for (var i = 0; i < amountToMint; i++){
await nftContract.methods.mint().send({ from: account, value: totalCost, gas: gas})
}

this will run 5 times but total cost is already 5 eth - so this will send 25 eth in total- the value field should be baseCost

also on the NFT.sol contract on line 42 i think you should be using
require(supply < maxSupply);
instead of
require(supply <= maxSupply);

the reason being that if you're already AT the max supply then it'll still mint one more.

<ps love the videos - thanks loads for doing this>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions