Cloning OpenSea NFT Boilerplate Questions

Hi, it’s been several days since I tried to make this project working with my contracts deployed on rinkeby network.

I have some issues either when i paste the ABI on the provider file and also when I try to get the NFTs from useNFTTokenIds.js file. In the second case, it seems that token.getAllTokenIds works only within the async function (like I’ve found in the docs) and not within useMoralisWeb3ApiCall (outside of useEffect call).

I checkout also to the suggested commit but both the issues are still there.

Any help?

Thank you!

Hi, was wondering if there is an updated working final code of this tutorial. So without the outdated “moralisDappProvider” and other stuff? Thanks!

I went and read this forum and github instructions before posting.

  1. Should I have had the NFT collection integrated into my wallet prior to starting the clone?

  2. I cloned the old git and checked and all went okay, but I think I may have missed some steps.

  3. I noticed the market.sol contract ABI steps in the github instructions were different than the video. I am not sure if that caused an error.

  4. When I finally ran the code, I only am viewing the traditional boiler plate. I am not seeing any of the NFT marketplace front end.

  5. Can you provide instructions if I was suppose to ‘add’ in the NFT’s in my wallet?

By the way, I am a moralis acadmey student, and in the hackathon, so while it’s great Moralis will have an NFT lauch pad, I am trying to learn coding, so I would appreciate any help! Thank you kindly!!!

example1|690x388

1 Like

How a user can create their own NFT on this clone??

ethereum boilerplate bro, i used yarn start but it says start not found and this error below`warning package.json: No license field
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

@cryptokid @Yomoo

Let’s continue here Ethereum Boilerplate Questions

1 Like

Hello Everyone,

I am having some issueas with creating a market item. Its say “TypeError: Cannot read properties of undefined (reading ‘call’)”. But when i look in the options of the body that gets fetched i have al the data.

Does anyone have any idea what this problem is?

what is the line that gives that error with undefined? a variable should be undefined there, not the parameters

I’ve successfully deployed the contract to Mumbai test net.
I’ve also been able to display my NFT collection on the explore page and under “My collections” tab.

However, something goes wrong when I list my NFTs for sale.
They appear in the database under CreatedMarketItems but nothing shows up under the “Transactions” tab and the NFT still is not listed as for sale under the “Explore” tab.

Does anyone know what might be causing this?
I’m using the OpenZeppelin ERC-721 standard for my NFT collection.

please how to make the ABI file in a sting format , ?

I am not sure what you are intending to do, but if you need to use the ABI of a smart contract I don’t recommend using the whole file, just a snippet is enough, but since it’s JSON, you can just stringify it by

JSON.stringify(ABI);

And the result of this will be string version of the ABI.

Is there a good way to load the NFT display page faster without having to check through all token ids each time?
I’m thinking maybe check once, send object to database and then use this database for displaying?

It would also need to be updated periodically or when a mint happens.

My issue is sometime the page times out or takes like 5 mins to fully load. Only 250 nfts

Hey @Apap,

Have you changed the NFTTokenIds.jsx and NFTMarketTransactions.jsx components to query for the CreatedMarketItems class you have in the database? The README suggests you name the class MarketItems, which the boilerplate was eventually made to respond to :slight_smile:

const queryMarketItems = useMoralisQuery(“MarketItems”); //what the boilerplate has
const queryMarketItems = useMoralisQuery(“CreatedMarketItems”); //what you need

1 Like

Hey @Nicole22 ,

Sorry for the little wait in response over Christmas. Great to see you are trying this out, it seems you have cloned the repo used at the start of the youtube tutorial, explaining why you are seeing the ethereum-boilerplate frontend. You should be able to follow along with the tutorial from here on out, but if you wish to checkout the marketplace boilerplate you should be able to clone this repo and follow its README instructions:

To test out the listing and purchasing functionality, you just need to have a NFT in your wallet (I would recommend some NFT in a testnet like Mumbai) and add this collection to the collections.js helper file :+1:

You were right, I had missed that.
Everything seems to work just fine now, thank you!!

1 Like

Hey @Fitz,

Checkout the documentation for the web3 getAllTokenIds call:

https://docs.moralis.io/moralis-server/web3-sdk/token#getalltokenids

You could use the limit parameter to only check through the N first NFTs and then use the offset parameter to load more when desired.

listed NFT work fine but after listing it still show “This NFT is currently not for sale” what i can do now.

@IAmJaysWay thank you for responding. I am looking forward to building this demo!

I did clone the repository. Couple more questions

  1. I launched the contract (per your instructions) and copied the ABI (after I put it in the clipboard as well), but moralis gave errors.

  2. In your github instructions you don’t mention using the ABI code (as it’s shown in the video) and the table name doesn’ match from the video. (see the above pic)

Thanks! I love this video!

1 Like

Hey @pkgujjar It may take a minute or so for the NFT to be set as “for sale” (due to the Moralis server waiting for the on-chain list event to change from pending to confirmed).

If waiting a while doesn’t work, you could check that the items you put up for sale are being updated to your Moralis database in to the MarketItems class. If they are updating correctly over there, it is most likely a error in the Moralis query (ie. querying for the wrong class name), but otherwise your sync event may not be set up correctly and I would try redoing that. :slight_smile:

@Nicole22

Make sure you have the contract ABI pasted as a stripped string to the MoralisDappProvider.js file, this has solved the problem for others in the past:

And as for the sync event you can follow the video step by step, but just change the table name from CreatedMarketItems to MarketItems as this has been changed in the boilerplate code :+1: