Cloning OpenSea NFT Boilerplate Questions

Dumb question @brown2020 but what did you use to strip it?

Hi @latok, you can follow along the youtube video
https://www.youtube.com/watch?v=WZWCzsB1xUE&t=4487s from timestamp ā€œ46:26ā€ onwards to see how to sync the smart contract hope this helps!

@Fitz The way I stripped the ABI to one big string without all the line breaks and formatting: Copy ABI to clipboard from Remix, then paste it into the search bar of Chrome. Chrome strips it all down for you. Then copy and paste that new stripped string into the useState initializer.

Now if I only could figure out how to do the sync part. The ā€œConfigure Sync and Watch Contract Eventsā€ in Moralis wonā€™t let me save. I have the ABI in there, the contract address and MarketItems as the table name, but there must be a couple of steps that Iā€™m missing that are not documented in the readme

Wow such a simple solution!

For the sync issue, make sure you have the chain selected at the top. The chains logo will have a checkmark on it. Got me earlier with that

Thanks @Fitz. I got the chain selected and now Iā€™m able to press the confirm button, but now I get the error ā€œInvalid ABI, The ABI should contain an array of inputs.ā€ I tried straight cut-and-paste from Remix and my strip-trick, and get ABI errors either way. Any ideas? Is this even the right place to be doing the sync?

Hi there, thanks again for making this tutorial. Iā€™ve got a couple of questions:

  1. I currently have no NFTs showing on my ā€œYour Collectionā€ page. This means I also cannot test out selling/listing NFTs. Does my Metamask actually have to own NFTs for them to show up there, or is there a way I can at least have test NFTs that show up there?

  2. When I click onto either the Test Mages or Pixel Show collections while in the Marketplace, it shows no NFTs. In contrast, the tutorial videos shows these NFTs, including those in the Your Collection page. However, NFTs of other collections such as Bored Apes show up. How do you think I can get the Test Mages and Pixel Show NFTs to appear?

Remove the [ ] from your abi and update your topic to include the required variables. Go through the tutorial video a few times, thereā€™s lots to miss

Just the first one starting at anonymous, or the whole list? I used this and it seemed to accept itā€¦

	{
		"anonymous": false,
		"inputs": [
			{
				"indexed": true,
				"internalType": "address",
				"name": "owner",
				"type": "address"
			},
			{
				"indexed": true,
				"internalType": "address",
				"name": "approved",
				"type": "address"
			},
			{
				"indexed": true,
				"internalType": "uint256",
				"name": "tokenId",
				"type": "uint256"
			}
		],
		"name": "Approval",
		"type": "event"
	}

And for the topic to subscribe, you put the whole event, like this?

MarketItemCreated (         uint indexed itemId,         address indexed nftContract,         uint256 indexed tokenId,         address seller,         address owner,         uint256 price,         bool sold      )

Remove all spaces from the topic and also remove the variable names, ie just have MarketItemCreated(uint,address,unit256ā€¦

1 Like

Hey @brown2020

You can use http://jsonviewer.stack.hu/ for fast JSON validating & formatting

Hey @ZeusExMachina,

Yes you will have to have some NFTs in your wallet to try the listing functionality, I would recommend minting a simple NFT collection (or acquiring a couple of NFTs), on a testnet like Mumbai and then also adding the details (contract address and abi) of this collection to the the collections.js file, this could help out with your question 2 as well.

/src/helpers/collections.js

1 Like

Iā€™m working along the video, i have some issues with ā€œparamsā€ of the contractProcessor function. What would i parse in when the params donā€™t have a name for the input in the ABI ?

Hey @HarryTgerman, usually that happens when the param variable is not used at all, so maybe you can have a try to have the params as empty object ({})

Thanks for your reply, i had to create a testnet server as my first one was mainnet. Iā€™ll try your solution.

Where is the address from (in above)? Iā€™ve used the example you gave in MoralisDappProvider.js

Where do i run the code from the repository? Iā€™ve cloned it to my desktop for local dev but iā€™d like to run it online so others can also see it, otherwise itā€™s only on my PC.

Iā€™ve tried to run it on heroku and vercel but no luck. Example below.

Also, where should i edit the files, at the moment iā€™m using notepad and saving.

Thanks

I also had this problem, I solved it by:
yarn cache clean
yarn info
yarn upgrade
yarn add yarn

Hope this helps

1 Like

Still no luck, full of errors.

Gitpod also cannot run it.

I donā€™t why nothing works on my local PC, iā€™ve tried everything inc updating, reinstalling nodejs, yarn etc.

Just keep getting same errors.

Constantly getting this at the end ā€œCommand failed with exit code 1ā€ and no solution works, iā€™ve checked many posts and they all say to clear yarn cache, upgrade, start etc but I canā€™t move forward from this.

Also this error ā€œcommit hash requiredā€ constantly.

Itā€™s so frustrating ā€¦

Hi @Latok,

I would suggest you still try and download an IDE like VS code, as you say you are opening the files in a notepad and savingā€¦ Having the whole folder open in the same environment and making edits to the files there could help out :slight_smile:

Hi, iā€™m using VS code too ā€¦ come up with the same errors. See below:

Anyone got a quick suggestion on a better ā€œtagā€ rendering method for the transactions tab in this project?

I have added a ā€œcanceledā€ column to the database and would like to render a tag also showing if the sale has been canceled. Maybe Iā€™m just not understanding the current tags.map((tag) =>