cryptoboys-nft-marketplace icon indicating copy to clipboard operation
cryptoboys-nft-marketplace copied to clipboard

transaction error when the second NFT to be mint

Open jianguda opened this issue 4 years ago • 5 comments

Thanks for sharing such a great NFT market implementation! However, I found a hidden but critical issue, that is when the second NFT to be mint, the MetaMask always claims a transaction error.

I tried to debug the contract but sadly I failed to find the real cause :< so I decide to report the issue to you!

Best!

jianguda avatar Sep 16 '21 18:09 jianguda

@devpavan04

jianguda avatar Sep 19 '21 11:09 jianguda

@jianguda can you share the metamask error.

devpavan04 avatar Sep 22 '21 10:09 devpavan04

@jianguda Depending on how you create the second token, you might run into an issue with the colours not being unique.

If you did something like me you'd end up getting a nondescript contract error with metamask because of the colour issue.

Token 1: You shift some of the colour selectors but leave a few as default. Token gets created. Token 2: You shift some of the colour selectors but leave a few as default. (At least one colour is not unique) Contract fails.

It comes from this part of the CryptoBoys.sol and isn't bug.

    // loop through the colors passed and check if each colors already exists or not
    for(uint i=0; i<_colors.length; i++) {
      require(!colorExists[_colors[i]]);
    }

There should be some sort of warning/popup about the colour not being unique but that message might have been missed by you. Try making sure that the colours you are using for each CryptoBoy is unique/set. Hopefully that resolves the issue you were seeing.

Yorzaren avatar Oct 21 '21 04:10 Yorzaren

@jianguda I have an error connecting the wallet. Can you show me this step? "CRYPTO BOYS CONTRACT NOT DEPLOYED TO THIS NETWORK. Connect Metamask to Kovan Testnet Or Localhost 7545 running a custom RPC like Ganache."

trandinhthang14 avatar Mar 18 '24 12:03 trandinhthang14